Logging a User Off

Neil Rickert rickert at mp.cs.niu.edu
Wed Sep 12 06:13:45 AEST 1990


In article <1990Sep11.173008.274 at mccc.uucp> pjh at mccc.uucp (Pete Holsberg) writes:
>For reasons that are beyond the scope of this question, all new logins
>on one of my systems (3B2.400 SVR3.1) get no initial password.  I've
>written a little script that I put into /etc/profile.  It examines the

 The way I handle new accounts is as follows:

  The initial shell is the restricted shell.  (Actually the restricted
kshell, or to be more precise a local front end which just execs to the
restricted kshell.

  /etc/profile detects the restricted shell (the $SHELL variable), and
sets a path with a very minimal set of commands.  In this case 'passwd'
is a shell script which invokes the real passwd command, and then check
for a changed password.

  If the password is changed, and if there is not non-empty file named
SUSPEND in the users home directory, then the shell script invokes
'chsh' to provide a decent shell, copies standard startup files to the
home directory if they are not present, and recommends that the user
logout then login again.

  A practical application is to set up new student accounts with no password,
the restricted shell, a non-empty SUSPEND owned by the course instructor, and
the home directory not publically readable.  When the student establishes
a password the directory is made readable.  That allows the instructor to
validate the account by copying /dev/null to SUSPEND.  At the next login the
.profile detects this, changes the shell etc.

-- 
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
  Neil W. Rickert, Computer Science               <rickert at cs.niu.edu>
  Northern Illinois Univ.
  DeKalb, IL 60115.                                  +1-815-753-6940



More information about the Comp.unix.admin mailing list