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 > 2006 > February
SysAdminMag.com

Implementing Standard Login Scripts

John Spurgeon and Ed Schaefer

Consider a server model where numerous Unix servers are distributed across numerous production sites hosting database engines and other software applications. Also, assume that only the local systems administrators have command-line access. We think standardizing the administrator's login scripts is a good way to maintain high application availability.

We could implement standard login scripts via skeleton directories. In the Solaris environment, the useradd command provides the -k option, which specifies a skeleton directory. Files from a skeleton directory, such as .profile, are copied into users' home directories when new accounts are created.

There are two reasons we shy away from using skeleton directories to standardize login scripts. First, it can be difficult to make changes to scripts once users have been added. Not only do files in the skeleton directories have to be modified, but all of the existing users' scripts have to be updated, too. Second, we did not want to give users access to the logic responsible for setting up the majority of their environment, and we thought that preventing users from modifying $HOME/.profile was too restrictive.

Instead, we placed the necessary environment setup commands in two special files: /etc/profile and /etc/.kshrc. When a user logs in, the program called "login" spawns a shell -- typically the Korn shell on our servers. The Korn shell looks for login scripts /etc/profile and $HOME/.profile and executes them if they exist. The Korn shell also looks for the file referenced by the environment variable ENV (set to /etc/.kshrc on our servers) and executes it if it exists; this happens whenever the Korn shell is invoked -- not just at login time.




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.

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

Wanna see your ad here?