Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

migrated from stackoverflow.com Oct 14 '13 at 10:13

This question came from our site for professional and enthusiast programmers.

3 Answers 3

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).

share|improve this answer

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)

share|improve this answer

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

Put

UseDNS no

into

/etc/ssh/sshd_config

restart and try

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.