SSH or GUI Logins Hang Connecting To A Linux System

If Both Your SSH and GUI Login Attempts Hang

There are instances where logging into to a linux system via SSH and via a GUI login (e.g. logging in from a login screen) might hang.

For example, you attempt to ssh into a linux box, and it accepts your credentials, and might actually provide a "Last login..." message, but then hangs, never returning a user prompt.

(If you're logging in via the GUI, then, you might not get any messages, just a hang.)

One possible cause: A locked .history file.

The fix for a locked .history file:

Attempt to ssh into the linux box. Once your login starts to hang, then do:

  • CTRL-C
  • rm .history