1、输入以下命令:ssh-keygen -t rsa

 

2、输入命令ls:产生两个文件:id_rsa id_rsa.pub

3、复制id_rsa.pub,并命名为authorized_key

cp ~/.ssh/id_rsa.pub  ~/.ssh/authorized_keys

4、执行ssh localhost。

验证成功:

The authenticity of host 'localhost (::1)' can't be established.
RSA key fingerprint is 07:07:8e:1c:c0:7e:7f:1f:ca:6a:e6:d3:cb:7f:b7:a1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (RSA) to the list of known hosts.

相关文章:

  • 2022-12-23
  • 2021-11-06
  • 2021-12-17
  • 2021-06-04
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-02-07
猜你喜欢
  • 2021-11-15
  • 2021-07-22
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
相关资源
相似解决方案