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 > April 2005

Using Screen in Scripts

Ed Schaefer and John Spurgeon

We expected reactions to our "Using Unknown Passwords" column, and we were right. We'll cover reader feedback before continuing with this month's column.

Revisiting "Using Unknown Passwords"

Readers Andrew Barber, Rob Tanner, and Christopher Baker asked about situations when you really need root's password. At OS boot-up, what happens when you are queried for root's password to execute fsck or to enter a different maintenance mode or run-level?

Depending on the situation, you might have to boot from external media to solve this problem. In our environment, we support systems consisting of a primary, a secondary, and a backup server. In the event of a boot problem, we promote our backup server to be the production server and fix the problem at our leisure.

In Baker's situation, at times he requires the actual root password for maintenance purposes, such as clearing screen locks and installing software. If a user has root privileges through sudo, that user has the ability to temporarily change root's password. Simply become root, execute "passwd root", and set a new password.

If necessary, the cron jobs that set passwords to random values can be temporarily disabled as well. (Although the column suggested changing root's password every minute, that's probably overkill in most situations.)

Carl Lowenstein suggests locking root's password instead of using our complicated procedure to periodically change the password. Lowenstein raises another excellent point -- one that we should have stressed in the article.

On Solaris, you can lock a user's password with the command:

passwd -l username
This inserts the string "*LK*" in the encrypted password column in /etc/shadow. This might be just as good as setting the password to a random value, provided you also turn off password aging with the command:

passwd -x -1 username
On Solaris, you have to be careful because if a user's password expires -- even if it is locked -- that user's cron jobs stop running.



MarketPlace

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.

Automate Software Builds with Visual Build Pro
Easily create an automated, repeatable process for building and deploying software.

WinDev 12 - Powerful IDE
Develop 10 times faster ! ALM, IDE, .Net, RAD, 5GL, Database, 5GL, 64-bit, etc. Free Express version

Web based bug tracking - AdminiTrack.com
AdminiTrack offers an effective web-based bug tracking system designed for professional software development teams.

Wanna see your ad here?