PTY allocation request failed on channel 0

Solution 1:

It appears like the server operator has adjusted the sshd configuration or setup options in the authroized_keys files to prevent you from getting an interactive shell. Server operators that want to provide sftp access only frequently do this.

debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.

Try connecting without using your keys for authentication. If you can get a shell when you don't use a key the problem is in your authorized_keys file. If you cannot login when trying to use password authentication, and password authentication isn't disabled, then the problem is going to be in the sshd_config.

Solution 2:

I had the same problem. Some gitolite configuration step had added another restrictive set of key that was causing problem. The problematic server side .ssh/authorized_keys had


ssh-rsa XXY-my-original-keyXXX some_name

#gitolite start

command="/usr/share/gitolite/gl-auth-command ubuntu",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa XXY-some-gitolite-keyXXX some_other_name

#gitolite end


I removed the gitolite section and I too was golden