![我已经创建了一个具有三个不同子网的 vpc,在从实例执行 ssh 时遇到问题。获取检查公钥错误](https://linux22.com/image/768069/%E6%88%91%E5%B7%B2%E7%BB%8F%E5%88%9B%E5%BB%BA%E4%BA%86%E4%B8%80%E4%B8%AA%E5%85%B7%E6%9C%89%E4%B8%89%E4%B8%AA%E4%B8%8D%E5%90%8C%E5%AD%90%E7%BD%91%E7%9A%84%20vpc%EF%BC%8C%E5%9C%A8%E4%BB%8E%E5%AE%9E%E4%BE%8B%E6%89%A7%E8%A1%8C%20ssh%20%E6%97%B6%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98%E3%80%82%E8%8E%B7%E5%8F%96%E6%A3%80%E6%9F%A5%E5%85%AC%E9%92%A5%E9%94%99%E8%AF%AF.png)
我已经创建了一个具有三个不同子网的 vpc,并且在从实例执行 ssh 时遇到问题。出现检查公钥错误,但之前成功了。
tarun@eu-vm:~$ ssh 192.168.0.3
Linux web-server-gqnt 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jun 29 19:06:40 2021 from 35.235.240.48
tarun@web-server-gqnt:~$
tarun@web-server-gqnt:~$
tarun@web-server-gqnt:~$ exit
logout
Connection to 192.168.0.3 closed.
tarun@eu-vm:~$ ssh 192.168.0.2
[email protected]: Permission denied (publickey).
tarun@eu-vm:~$
tarun@eu-vm:~$
tarun@eu-vm:~$ ssh 192.168.0.3
[email protected]: Permission denied (publickey).
tarun@eu-vm:~$
tarun@eu-vm:~$
答案1
对于 ssh 通信,它会检查密钥是否安全。因此,您不应该向所有人授予完全权限。
将权限更改为:
chmod 600 <keyfile>
答案2
您可以使用以下命令检查 ssh 端口的连接是否正常:
telnet 192.168.0.2 22
如果它要求您按 中止,^]
只需按Ctrl
+]
然后输入quit
。如果这样有效,您可以建立与 192.168.0.2 的 ssh 端口的连接,但之后会出现问题。