问题:创建了新的云服务器实例,通过腾讯云控制台的WebShell可以登陆实例(TCP:22证明放开),并且我的笔记本也可以ping通我的ID(公网证明可以访问)。
上图可以看到可以登陆,但是接下来用我的SSH工具,同样的ip与端口则不行:
原因:刚创建的实例中用户只有root,默认root用户不能以远程方式登陆。
解决:
1.先从webShell进入,编辑vim /etc/ssh/sshd_config
文件,将如图的PermitRootLogin yes
三行注释放开
2.在PasswordAuthentication yes
的后面追加如下加密相关代码
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-n
istp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
如图: