SSH 中 PTY allocation request failed on channel 0 /bin/bash: No such file or directory

在centos7的目录下
远程连接SSH
通过密钥访问,密钥验证通过,但是依旧访问失败

$ ssh -T -v -i G:/id_rsa [email protected] -p 2345
OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 192.168.0.107 [192.168.0.107] port 2345.
debug1: Connection established.
debug1: identity file G:/id_rsa type 0
debug1: identity file G:/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
debug1: Authenticating to 192.168.0.107:2345 as ‘gx’
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: compression: none
debug1: kex: client->server cipher: [email protected] MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:OgJRdwojFB9rnfqGpZSRgKQVtCyRvFcwxCIDbgAETKE
debug1: Host ‘[192.168.0.107]:2345’ is known and matches the ECDSA host key.
debug1: Found key in /c/Users/yao64/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: G:/id_rsa RSA SHA256:L+rgkz84aCAE89pla2vnkqM2wCCtq5KDyq1Wd6GWbDU explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: publickey
debug1: Offering public key: G:/id_rsa RSA SHA256:L+rgkz84aCAE89pla2vnkqM2wCCtq5KDyq1Wd6GWbDU explicit
debug1: Server accepts key: G:/id_rsa RSA SHA256:L+rgkz84aCAE89pla2vnkqM2wCCtq5KDyq1Wd6GWbDU explicit
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.0.107 ([192.168.0.107]:2345).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
/bin/bash: No such file or directory
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2764, received 2768 bytes, in 0.2 seconds
Bytes per second: sent 15355.0, received 15377.3
debug1: Exit status 1

我们可以看到debug1: Authentication succeeded (publickey).
密钥验证是通过的,但是下面报错

debug1: client_input_global_request: rtype [email protected] want_reply 0
/bin/bash: No such file or directory

我去远程服务器看,发现

也是可以显示的,这里我用的是gx用户,图片中的是root用户,但效果是一样

请求解答现在该怎么办,请求各位大佬赐我真理!!!
在这里插入图片描述

你可能感兴趣的:(SSH 中 PTY allocation request failed on channel 0 /bin/bash: No such file or directory)