You'll almost certainly be looking at a failure during the login process. Something is hanging and preventing you from reaching an interactive shell.
Try the following tricks to get back in:
- Log in as a different user / find someone else on the server with a login, then
su <your username>
(note the lack of '-' in su, this skips the target user's environment) - Log in as root / ask the sysadmin to edit your profile for you as root
- Connect via
ftp
orftps
- Try your luck via a non-interactive link like
scp
,rsync -e ssh
, orsftp
Provided one of these tricks gets you access and you get an interactive shell, you should then move aside your profile files:
mkdir broken-profile-files ; mv .profile .bashrc .login .cshrc .bash_profile broken-profile-files
If you have a non-interactive shell via something like ftp, use ls
or ls -a
to identify any profile files and either move or delete them (typically rename
or delete
)
If you can get in via something like rsync, you can backup the current version of the files first by doing an rsync pull, then push an empty file back up to overwrite it.
Once you are back in and running with an empty profile do the following to debug:
- Open a new shell, leave it open, don't touch it, don't close it. In fact, open two, why not? This will be your "get out of jail free" card.
- Now copy back your profile files one by one, attempting to login via a new window each time until you get the problem back
- Either add set -x to the top of the file that's giving your trouble or throw a few
echo "Here"
lines in it to track how far through you get before it freezes - Identify the issue and debug/prune as required
Probably causes of a hang:
- Attempting to explore a directory tree that's invalid or stale (eg shell expansion of * on a stale NFS mount of autohome directory)
One last thought: There's also the possibility that you have a larger fault in one of the global config files, in which case I'd recommend you just come up in single user mode and fix it that way.