我正在尝试首次连接到SSH。但是它说
The authenticity of host '[<host>]:<port>' can't be established.
ECDSA key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[<host>]:<port>' (ECDSA) to the list of known hosts.
root@<host>: Permission denied (publickey).
是否有违规行为?
您在那里有两条消息。
首先是告诉您您尚不知道要连接的计算机的公钥的指纹。接受指纹之前,请通过单独的安全通道进行传输,以检查指纹是否正确(如果其他人看到指纹,可以的,但是他们一定不能用自己的指纹替换)。
第二部分root@<host>: Permission denied (publickey).
有点模棱两可。但是这里有一些要检查的东西:
sshd
(服务器)通常配置为阻止root登录。您需要添加一个具有sudo
权限的新用户。或较差的解决方案是更改的配置ssh
,以允许root登录。
然后检查,您是否:
~root/.ssh/authorized_keys
?~root/.ssh
或其中的文件,但root至少可以读取。ssh-add
)。如果那不起作用,则打开详细模式-v
或-vv
或-vvv
,从1开始,然后根据需要增加。
如果那不起作用,请查看远端的日志。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句