login — provide convenient default login setup on the shared course accounts
exec ~isg/bin/login
The last line of the file
/u/
should be:csXXX
/.login
login is designed to provide convenient setup
for those new to Unix, including a personalized home subdirectory
and a customized environment including a PATH
that
already includes the ISG tools.
This command sets up an environment on the course accounts where
every user who logs in gets their own home directory (/u/
), allowing for
convenient, automatic personalized configuration. It also takes some
courtesy steps such as executing the remote user's preferred shell.
The csXXX
/u/remoteuser
PATH
will be set, in order, to the course account's
bin directory, the remote user's bin directory, and then the isg bin
directory if each of these are readable and executable from the course
account; after this, the search will fall back on the GNU and standard
paths. The MANPATH
will also be set such that the
documentation for the GNU tools and the ISG scripts can be found by
man.
The detection of the remote user's identity is done by examining
the REMOTEUSER
environment variable. This will be set automatically on
the CSCF environment by the rsh command, but in cases where this
variable has not been set (for example, when using ssh), the program
will prompt for entry of the remote userid. If the response happens to
be the empty string, then the home directory is set to /u/
.csXXX
The login script also reads the remote user's default shell, and
loads that on the course account to provide a familiar environment.
It will attempt to symlink the remote user's
.cshrc
to the course account subdirectory's
.cshrc
, as well as the files
.profile
, .bashrc
,
and .vimrc
.
The script also sets up the default path so programs like
rst can be found. In addition to the ISG tools, it
will also automatically include the remote user's bin
directory, as well as the course
account's bin
directory. To
prevent the CSCF default .cshrc
from wiping out
these changes to PATH
, it also sets the environment
variable DONE_ENVIRONMENT
to the value "done."
Assuming the default shell of the course account is csh or tcsh,
the file /u/
will still have an impact upon login. This is not desired, as the
remote users' home directories should contain any desired
configuration beyond the default.csXXX
/.cshrc
If a global .cshrc
really is desired, then
be sure to keep it minimal as a courtesy to other users of the
shared course account.
Most course accounts should run tcsh by default. However,
it is possible to change the login shell to bash, which then
will disregard the contents of .login
.
The solution is to create a .profile
in
the course account root directory, with no contents except
the following:
source /u/csXXX
/.login
The prompt that is given when REMOTEUSER
is not set
can cause problems for some ssh-based applications. Because of that,
it may be desirable to provide some configuration on the course
account for login.
One way to set REMOTEUSER
automatically is to
place a userid in the file
/u/
. If the
csXXX
/.login-default-userREMOTEUSER
environment variable has not been
set, then the user specified in this file will be used as
REMOTEUSER
automatically. This allows ssh to be
used without being prompted to enter the remote userid, but at the
cost of losing automatic personal configuration for anybody but the
default user who does not have REMOTEUSER
set
for them. As mentioned above, the default user can be the empty
string, making the course account's root directory home.
Another way to set REMOTEUSER
is less clean, but
it allows personalized configuration in certain circumstances. If
there is a unique way to identify a remote user in the given term
(for example, a server that only one staff member uses), then this
check can be done in /u/
before
the ISG account login is execed, and csXXX
/.loginREMOTEUSER
can be set as appropriate on success. For example,
if ( $REMOTEHOST == my_personal_server ) then setenv REMOTEUSER my_userid endif