14

So I googled the error and checked serverfault, but the solutions didn't fit. Most results were problems with /dev/pts, but that is mounted. Other results are errors with git, but there is no git on the machine.

My account isn't blocked, I can still log in on the console. Other users also have this problem, so I don't think it has something to do with something that's in my .ssh/

I get this response with ssh -vv:

<snip>
debug1: Next authentication method: password
rogier@server's password: 
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug2: callback start
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug2: channel 0: request shell confirm 1
debug2: fd 3 setting TCP_NODELAY
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 100 id 0
PTY allocation request failed on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0

After this the session freezes. Does anyone have any idea what's going on?

6
  • 6
    Are you able to use ssh user@host "/bin/bash -i" to login?
    – Tim
    Jan 18, 2012 at 18:20
  • hmm.. yeah, that works... Jan 18, 2012 at 19:11
  • 1
    I have seen a case where the /dev/pt* devices needed to be removed and manually re-added because they became corrupt. And in that case, using the work-around I listed above also worked.
    – Tim
    Jan 18, 2012 at 20:20
  • @Tim I have the same problem. I can also login with ssh user@host "/bin/bash -i. Could you be more specific on what commands I have to run to fix this? How do I restore /dev/pt*? Thanks. Sep 10, 2014 at 22:37
  • 4
    @user2609980 run mount, one of the lines outputted should be /dev/pts, make note of the options. Unmount with umount /dev/pts and remount with mount -t devpts -o OPTIONS devpts /dev/pts replacing OPTIONS with the options you observed prior to unmounting.
    – Tim
    Sep 15, 2014 at 18:46

7 Answers 7

11

Ok, thanks to Tim. umounting /dev/pts and then mount /dev/pts did the trick.

5
  • This is very strange. Any idea why this is so? Is this a device driver bug or something else? Has it been fixed? etc...
    – not2qubit
    May 31, 2014 at 19:50
  • No idea. And I haven't seen it again. Jul 1, 2014 at 15:00
  • 1
    @blauwblaatje I have the same problem. I can also login with ssh user@host "/bin/bash -i. Could you be more specific on what commands I have to run to fix this? Thanks. Sep 10, 2014 at 22:37
  • As far as I can remember, I only did: umount /dev/pts && mount /dev/pts Nov 19, 2014 at 9:45
  • I just had the problem and had to mkdir /dev/pts before it worked. Otherwise this solved the problem for me. Jul 21, 2015 at 21:42
2

let me tell you all my experience, I try to connect from linux to windows via ssh, had servers with openssh and others with freessh. When the server has openssh it work fine, but since a time to now it start to present a "shell request failed on channel 0" message when freessh is the service running (it came from one day to another, it use to work better that openssh)

A test made by me was to try stablish conection from another user, as i see that it works fine, I backup my ~/.ssh (the user that present the problem), and after that it works fine.

I think the file involved was known_hosts, the perms looks fine as well as the content, but that was how I fix it.

1

The error just means that opening the pseudo terminal failed. Most likely it has nothing to do with ssh. To debug it on the ssh server side use a very simple PTY demo like mypty in http://rachid.koucha.free.fr/tech_corner/pty_pdip.html to see whether any PTY can be allocated at all. If not, use strace to investigate where it fails. (For me it was a missing /dev/ptmx symlink in a container as explained in https://www.kernel.org/doc/Documentation/filesystems/devpts.txt )

1

While mounting again I get,

warning: can't open /etc/fstab: No such file or directory

But,

mount devpts /dev/pts -t devpts

do the trick

Reference: http://www.iitk.ac.in/LDP/LDP/lfs/5.0/html/chapter06/proc.html

0

Could depend on you LANG and your LC settings, but this works for me:

unset LANG        2>/dev/null
unset LC_MONETARY 2>/dev/null
unset LC_NUMERIC  2>/dev/null
unset LC_MESSAGES 2>/dev/null
unset LC_COLLATE  2>/dev/null
unset LC_CTYPE    2>/dev/null
ssh -l username hostname
2
  • 3
    Why do you think the problem could be related to the LANG and LC_* environment variables? Nov 13, 2012 at 13:52
  • I am wondering what I changed before this started happening. I actually did change some of these variables! Let's see if it also works for me. Sep 15, 2014 at 19:44
0

In my case, I was connecting to a Windows host (running cygwin and other related softwares) from a Linux box.

Strangely attempts to connect to windows server did work but failed while allocating interactive terminal. Check ssh -vv logs below.

...
Authentication succeeded
...
Entering interactive session
Requesting authentication agent forwarding.
Sending environment.
Sending env LANG = en_US.UTF-8
PTY allocation request failed on channel 4
...

My colleague figured out that it was because of many open processes on windows server which was using the same login credentials as mine and doing some automated batch operation.

Killing it temporarily, did the trick, and allowed my ssh connection successfully.

Most likely, windows + cygwin, had max limit in that regards. Work remains to de-allocate resources correctly when those processes are done running.

0

I've just had this same issue when trying to SSH in to any machine after I had been playing around with generating new SSH certificates. Re-mounting /dev/pts didn't do anything for me, but clearing the identities from my local ssh-agent did work:

ssh-add -D

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .