How to fix request failed on channel 0

后端 未结 20 2562
甜味超标
甜味超标 2020-12-04 16:42

When I want to connect to my server like this

ssh -a username@my-server.de -p 22

it gives me two error messages:

PTY alloca         


        
相关标签:
20条回答
  • 2020-12-04 16:56

    I solved a similar problem with one of our users who was used only for ssh port forwarding so he don't need to have access to PTY and it was prohibited in .ssh/authorized_keys file:

    no-pty ssh-rsa AAA...nUB9 someuser
    

    So when you tried to log in to this user, only message

    PTY allocation request failed on channel 0
    

    was returned. So check your user's authorized_keys file.

    0 讨论(0)
  • 2020-12-04 16:56

    This was happening when I was trying to use sudo on ssh -t git@github.com after adding my local user's public key to github

    Just a head's up to the google happy people like me

    0 讨论(0)
  • 2020-12-04 16:58

    unmount and mount /dev/pts worked for me

    umount /dev/pts
    
    mount devpts /dev/pts -t devpts
    

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

    0 讨论(0)
  • 2020-12-04 17:00

    Just add these lines to your /etc/mtab and /etc/fstab, and reboot the system.

    none    /dev/pts    devpts    defaults    0    0
    
    0 讨论(0)
  • 2020-12-04 17:01

    I occasionally see this when spinning up a VM. Our automation system starts applying updates, so depending on timing can hit an update to critical packages.

    Upshot - this might happen if ssh or other related packages are being updated on the destination machine.

    0 讨论(0)
  • 2020-12-04 17:04

    rebooting the instance from AWS console worked for me. There was a service that was leaking file connections that lsof helped find.

    0 讨论(0)
提交回复
热议问题