小编Can*_*sin的帖子

如何在没有密码的情况下通过 SSH 连接到本地主机?

编辑:准确地放置所做的事情。

我需要在localhost没有密码的情况下通过SSH 连接,通常的做法(使用公钥)不起作用。

user@PC:~$ rm -rf .ssh/*
user@PC:~$ ssh-keygen -t rsa > /dev/null 
Enter file in which to save the key (/home/user/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
user@PC:~$ ls .ssh/
id_rsa  id_rsa.pub
user@PC:~$ ssh-copy-id -i localhost 
The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is f7:87:b5:4e:31:a1:72:11:8e:5f:d2:61:bd:b3:40:1a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.
user@localhost's password: …
Run Code Online (Sandbox Code Playgroud)

ssh passwords openssh user localhost

17
推荐指数
2
解决办法
7万
查看次数

标签 统计

localhost ×1

openssh ×1

passwords ×1

ssh ×1

user ×1