ssh无法连接到服务器

lgqfhwy
  • 62

使用ssh无法登陆服务器,服务器是我刚买的砖瓦工,无论怎么重装系统还是不行,我能确定输入密码都是正确的。
我用的 Mac terminal, 服务器系统是centos6
整个系统登录对话及debug如下所示:

JackdeMacBook-Pro:~ lgq$ sudo ssh -p 26106 [email protected]
Password:
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
JackdeMacBook-Pro:~ lgq$ sudo ssh -v -p 26106 [email protected]
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to 176.122.138.37 [176.122.138.37] port 26106.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /var/root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000
debug1: Authenticating to 176.122.138.37:26106 as 'lgq'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: [email protected] compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: [email protected] compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<3072<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:4XNDeQacNpoE+/4lvFL0vxKU+/lLMnCBGQ6CrftH3C0
debug1: Host '[176.122.138.37]:26106' is known and matches the RSA host key.
debug1: Found key in /var/root/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /var/root/.ssh/id_rsa
debug1: Trying private key: /var/root/.ssh/id_dsa
debug1: Trying private key: /var/root/.ssh/id_ecdsa
debug1: Trying private key: /var/root/.ssh/id_ed25519
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
[email protected]'s password: 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.
[email protected]'s password: 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
JackdeMacBook-Pro:~ lgq$ 

最后再说一句,我能确定输入密码是正确的,但是老是出现不允许,不知道怎么回事,请各位帮忙看一下。

回复
阅读 4.1k
3 个回答
航海家
  • 160

呃呃呃呃,没有root账户吗,我还没遇到过这种情况哎,有没有被坑啊?

clipboard.png

之前我遇到过类似的问题

某些时候,在terminal下粘贴的时候会有一些类似[A [e 这样的字符被带进去,原因我也不知道

不过你可以试试完全退出terminal重新打开再试试

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏