Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2005 > February 2005

Using Unknown Passwords

Ed Schaefer and John Spurgeon

Often, several administrators have root privileges on a system. In cases where people are allowed to log in as root or use su to become root, more than one person needs to know root's password.

Sharing root's password presents challenges and raises security concerns. How do you know who did what as root? Who gets to change root's password, and how is information communicated? How do you revoke or change someone's access to a system when they know root's password?

Instead of sharing root's password, consider setting root's password to a value that nobody knows.

With sudo, root privileges can be granted to individuals even though root's password is unknown. (This technique can be used to manage passwords for any privileged account -- not just root.) A carefully crafted program can automatically generate a strong password. Finally, an entry in root's crontab file can periodically set root's password to a random value.

This column describes the sudo setup; a Korn shell script, genpass, that generates a random password; and two methods for root to automatically set the password.

Granting Root Privileges with sudo

Sudo is a free utility that allows a user to run commands as root or any other user without having to know another user's password.

Below is a simple /etc/sudoers file that gives tom, dick, and harriet the ability to become root without needing to know root's password:

Cmnd_Alias BECOME_ROOT = /sbin/su - root
User_Alias SUPER_USERS = tom, dick, harriet
SUPER_USERS ALL = BECOME_ROOT
For members to log in as root, they must execute this command:

sudo su -
If this seems too complicated, you could create an alias such as:

become='sudo su -'
Now, all the user has to type to become root is:

become root
Although sudo setup is outside the scope of this article, it is worth noting that you should always edit the /etc/sudoers file using visudo; this is analogous to using vipw to edit /etc/password.



MarketPlace

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.

Villanova University Six Sigma & IT Certificate Programs
100% Online programs in Six Sigma, IS Security, CISSP Prep, Business Analysis, Proj. Mgmt. and more!

Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Wanna see your ad here?