Have an experienced user look at your shell's. There could be some obvious mistakes that you didn't catch.
Log in to another account and use the command (if the stuck account uses Bourne-type shells) or the su -f stucklogin command (if the stuck account uses csh or tcsh). Change (cd) to the home directory. Rename the account's setup files so the shell won't see them as you log in.
If you can log in after that, you know that the problem is with the account's setup files.
You'll see each line read from the .profile and the commands executed on the screen. If you don't see anything, then the shell probably didn't read the .profile. C shell users should put this command at the top of .cshrc instead:
set echo verbose
Note that on many UNIX systems, the shell won't read its startup files if the files aren't owned by you. You might useto check.
Look at the entry in the
Be sure it has the correct number of fields (separated by
Also, see if there's another user with the same login name.
(If your system has the commands vipw(8) and pwck(8),
your system administrator should be using them to edit and check the
They avoid many of these problems.)
To fix that problem, su to the account as explained above and take the command or directory name out of your startup file. Or, if this problem happens a lot, the system administrator can mount an NFS filesystem "soft" (instead of the default, "hard") and limit the number of retrys.
What looks like a "hang" might also be that you just aren't getting any output to the terminal, for some very weird reason. Then the set -xv wouldn't help you. In that case, try adding this line to the start of the .profile:
exec > /tmp/sh.out.$$ 2>&1
There's no command like that for the C shell.