Since this morning I cannot login normally on my server using SSH anymore.

Typically, when typing this:

ssh foo@bar.org

The shell hangs and does not acquire shell. The last line of verbose with -vv gives me:

debug2: shell request accepted on channel 0

That said, if I launch a command directly in SSH, such as:

ssh foo@bar.org 'ls ~'

...it seems to work properly and it gives me the expected output. Actually, I can get a shell by forcing bash to launch in interactive mode, by typing:

ssh foo@bar.org 'bash -i'

I also tried to disable my .bashrc file (by moving it to .bashrc_OLD), but it didn't seem to be of any help.

Any suggestion would be much appreciated, thanks!

Edit: I've also tried to login with sh, but it didn't work neither. Thus I believe this is not related to a profile file issue.

Edit 2: when I manage to get a shell using the -i flag, here is the additionnal message I get from the console:

bash: cannot set terminal process group (-1): Invalid argument
bash: no job control in this shell

I think you need to check the remote passwd database (by default /etc/passwd) and see what shell is there (you can then check it via running it directly like you already do with some commands). Other place to look for apart from shell dot files in your home directory is /etc/pam.d and then you should check your remote ~/.ssh directory as well especially if you're using keys to log in.

The terminal issue may mean that bash -i expects a terminal, which can be triggered by ssh -t (it's turned off by default when running a command directly).


Looks like you don't have /dev/pts mounted (on the server). Login by other means (physical console) and mount it with mount -tdevpts pts /dev/pts/ and then try again.

If you have no physical access to your server you can try from your client: ssh foo@bar.org 'mount -tdevpts pts /dev/pts/' (not tested)


I've had similiar lags and found out that disabling reverse DNS solved the issue.


UseDNS no



restart and try

  • It didn't work, I'm afraid. Please also note that this is not just a lag, as it hangs indefinitely after "shell request...". – driscan Oct 14 '13 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.