Suddenly I get "Server refused to allocate pty"

Got problems with your B2 or B3? Share and get helped!
Post Reply
theWebalyst
Posts: 96
Joined: 27 May 2010, 14:53

Suddenly I get "Server refused to allocate pty"

Post by theWebalyst » 12 Jun 2013, 12:34

A few days ago I set up passwordless ssh on a very clean b3 install. It was working from Windows (PuTTY & Command Prompt) and a Linux PC. Last night my Windows machine rebooted (thank you Windows Update) killing two or three b3 console sessions. When I tried to ssh back in using PuTTY I couldn't using the previous passwordless method.

Every time I try to ssh with a passwordless key from Windows (PuTTY or Command Prompt), the key is authenticated but I get the error "Server refused to allocate pty". From the Windows Command Prompt console (using cygwin or OpenSSH - I forget which!) ssh also fails but with a slightly different error message: "PTY allocation request failed on channel 0"

I can ssh and login with password, just not using passwordless authentication. I rebooted b3 but the problem remains.

ssh -vvv reveals:

Code: Select all

[snip]
debug1: Authentication succeeded (publickey).
Authenticated to b3 ([192.168.1.n]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Remote: Port forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug2: channel 0: request shell confirm 1
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
Linux b3 2.6.39.4-11 #1 Tue Apr 3 21:45:12 FET 2012 armv5tel
[snip]
Everything seems ok on b3 (e.g. in /dev/devpts is mounted on /dev/pts), so I'm not sure why it has started to fail.

Another strangeness - I set up passwordless ssh so that I could automate rsync from Windows 7 Task Manager to b3. This appears still to be working - so b3 is presumably accepting passwordless keys in some situations, but no longer from the previously working PuTTY configuration.

Any ideas?

Thanks,

Mark

Ubi
Posts: 1547
Joined: 17 Jul 2007, 09:01

Re: Suddenly I get "Server refused to allocate pty"

Post by Ubi » 12 Jun 2013, 16:07

Code: Select all

debug2: shell request accepted on channel 0
you are actually logging in successfully. But then something weird happens and you are disconnected. The PTY error is a bit of a non-specific error imho, which does not help so much.

You showed the debug output of the client, but it is very helpful to increase logging on the server too. Have you tried this?

theWebalyst
Posts: 96
Joined: 27 May 2010, 14:53

Re: Suddenly I get "Server refused to allocate pty"

Post by theWebalyst » 12 Jun 2013, 16:44

Ubi wrote:You showed the debug output of the client, but it is very helpful to increase logging on the server too. Have you tried this?
No, how do I do that?

Thanks, Mark

Ubi
Posts: 1547
Joined: 17 Jul 2007, 09:01

Re: Suddenly I get "Server refused to allocate pty"

Post by Ubi » 12 Jun 2013, 17:04

edit /etc/ssh/sshd_config by changing the loglevel value
http://www.manpagez.com/man/5/sshd_config/

important: after editing, reload ssh (/etc/init.d/ssh reload). Then DO NOT LOG OUT. Verify first that sshd still works by starting a second SSH session.

theWebalyst
Posts: 96
Joined: 27 May 2010, 14:53

Re: Suddenly I get "Server refused to allocate pty"

Post by theWebalyst » 17 Jun 2013, 11:42

@Ubi - many thanks for your help.

The mystery remains however, because after a second unwanted reboot by my Windows machine, and before I could investigate it, the problem has gone away (for now)!

Mark

Ubi
Posts: 1547
Joined: 17 Jul 2007, 09:01

Re: Suddenly I get "Server refused to allocate pty"

Post by Ubi » 17 Jun 2013, 15:55

Lets hope it stays gone! Thanks for checking back To the forum :D

Post Reply