我已经创建了一个具有三个不同子网的 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 端口的连接,但之后会出现问题。