previous contents up next

Unix for Advanced Users

2. Logging In

2.6. Common problems when logging in

It is not always possible to log in. This is almost always due to one of a common easily spotted errors.

2.6.1 An unreachable machine

If you are logging in across the network, it is possible that the remote machine is simply not reachable, either because of a problem with the network itself or because the machine is down. A sure sign of this problem is that the login: prompt never appears.

2.6.2 An absent service or a disabled account

If you get a "Connection refused" message when using telnet, one of two things is wrong: Either your account has been disabled or the telnet service is not running on the remote host. The same problems can be deduced if you are using ssh and it gives you an "Permission denied" message, even though you are sure you are typing your password correctly.

An account can be explicitly disabled in the file /etc/passwd (or in /etc/shadow, for Unix implementations that use it) by placing a special character in the password field of the user's entry. If you suspect your account is disabled, you must ask someone with the root password to log on and change the appropriate files.

2.6.3 A bad shell or a botched dotfile

If you enter your password only to get the message "Connection closed by foreign host", one of two things may be happening. The first possibility is that the shell you selected is not present or simply not executable because of its permissions. You can usually discount this possiblity if you did not set your own shell using chsh. "Closed" connections also occur when the shell exits prematurely because of an error in one of your shell's dotfiles. In either case, you will need an administrator's help to fix the problem.

2.6.4 /etc/shells (ftp)

If you are using ftp to connect to a machine where you know you have an account, but the program denies you access as soon as you enter your username, then the shell defined in your /etc/passwd entry does not appear in the file /etc/shells. The latter is a list of accepted shells used by ftp as an added security measure. The solution, of course, is to have the administrator change /etc/shells or to change your shell itself using the chsh command, if available.

previous contents up next