UpFront

The UpFront Section

UpFront

Tech Tip

If you get tired of typing your password for sudo, but you don't want (or don't have permissions) to put NOPASSWD in your sudoers file, you can use the following procedure to update the sudo password timestamp and avoid typing your password.

Step 1) Create $HOME/bin/sudo-hack.sh:

#!/bin/bash
while [ true ];
do
    sudo -u root /bin/true > /dev/null 2> /dev/null
    sleep 60
done

Step 2) Do an initial run of sudo to set its password timestamp:

$ sudo -u root /bin/true
Password: *******

Step 3) Start $HOME/bin/sudo-hack.sh in the background:


$ HOME/bin/sudo-hack.sh &

Now you can use sudo without getting a password prompt, regardless of how long it's been since the last time you ran sudo.

Note: there are most certainly security implications related to using this procedure; of course, that's also true of using NOPASSWD in the sudoers file.

Tech Tip

The following methods can be used for resetting the root password if the root password is unknown.

If you use GRUB for booting, select the system to be booted, and add 1 to the end of the kernel boot command. If you're not presented with an edit “box” to add boot parameters, try using GRUB's edit command (the letter e). The 1 tells the kernel to boot to single-user mode.

The system now should boot to a root prompt. At this point, simply use the passwd command to change the root password.

Another option is to boot a rescue CD or an installation CD that lets you get to the command line. Once you're at a command prompt, mount the system's root directory if it's not already mounted:

$ mkdir /mnt/system
$ mount /dev/sda1 /mnt/system

Now, do a chroot and reset the password:

$ chroot /mnt/system
$ passwd

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState