I am getting an error "Server refused to allocate pty"

Linode Staff

I get an error Server refused to allocate pty when trying to connect to my Linode in Putty.

When I try to use Windows SSH, I get the error PTY allocation request failed on channel 0.

I have turned on verbose output in Windows SSH and do not see any error messages that seem related to this problem.

There are messages about various missing identity files that Windows is looking for and cannot find, but I am unsure if they are related:

debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\MyUserID/.ssh/id_rsa type -1

Further down the debug output I see that I am authenticated:

debug1: Authentication succeeded (password).
.
.
.
PTY allocation request failed on channel 0

I was previously using SSH Keys to authenticate, but I cannot login anymore.

1 Reply

Possible causes for "Server refused to allocate pty" or "PTY allocation request failed on channel 0" Error

This means that either the server cannot allocate a pty or it won't.

Possible reasons why the server won't allocate a pty

I am guessing here, but this could be because your SSH client is not able to find the relevant ssh key to provide to the server and the server is configured to require public key login.

Reasons why the server cannot allocate a pty

- Permissions on /dev/pts devices are not set so that sshd can read them or /dev/pts devices have been deleted.

ls -la /dev/pts/* should be able to show your terminal devices and their permissions.

- All of your pty devices have been allocated to other processes

You can use lsof /dev/pts/* to see which processes are using your psuedoTTYs. You should also be able to look for zombie processes in top. (They will have a status of Z). If you see a lot of these, they may be holding on to your psuedoTTYs.

There may be other reasons this error message may be displayed.

Other reasons

If none of these checks works for you, I would encourage you to create a new Linode and configure SSH access to test your client's correct functioning.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct