Shell Problems

If a user can log in and get past the password prompt but still has problems, there is a good chance the problem is with the configuration.

User Profile Files

Login shells source several files during login. These files enable a user's environment to be customized. This is where the environment variables such as PATH, PS1 (shell prompt), and MAIL are set. Because these files can be customized, there is a chance that they will cause login problems.

The bash shell is the most commonly used Linux login shell and is the default when adding users with useradd. The files executed at login in order are:

  1. /etc/profile

  2. user home directory /.bash_profile

  3. user home directory /.bash_login

  4. user home directory /.profile

All these files do not have to be present. The /etc/profile configuration file is executed by all users. If there is a problem in /etc/profile, it should affect all users. If just a few users are having a problem, /etc/profile is probably not the cause.

The easiest way to troubleshoot this issue is to temporarily replace the dot files with the default versions from /etc/skel and see whether the problem still occurs. If not, move the custom dot configuration files back one at a time until the problem file is found.

The following is from a Red Hat 3.0ES system:

# ls -al /etc/skel total 52 drwxr-xr-x    4 root    root       4096 Feb 11 05:51 . drwxr-xr-x   72 root    root       8192 Feb 12 06:41 .. -rw-r--r--    1 root    root         24 Aug 18 13:23 .bash_logout -rw-r--r--    1 root    root        191 Aug 18 13:23 .bash_profile -rw-r--r--    1 root    root        124 Aug 18 13:23 .bashrc -rw-r--r--    1 root    root       5542 Sep 16  2003 .canna -rw-r--r--    1 root    root        237 Feb  3 10:55 .emacs -rw-r--r--    1 root    root        120 Aug 24 08:44 .gtkrc drwxr-xr-x    3 root    root       4096 Aug 12  2002 .kde drwxr-xr-x    2 root    root       4096 Feb 11 05:49 .xemacs -rw-r--r--    1 root    root        220 Nov 28  2002 .zshrc


If you use ls -l /etc/skel, you won't see any files. The -a option shows files that start with a dot (.).

The configuration files in /etc/skel are what useradd puts in a newly added user's home directory.

Linux Troubleshooting for System Administrators and Power Users
Real World Mac Maintenance and Backups
ISBN: 131855158
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Joe Kissell

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: