ssh免密登录

实现目标: 服务器A免密登录服务器B

在服务器A上生成密钥对

~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/local/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

复制公钥到服务器B,用于免密登录服务器B:

~$ ssh-copy-id -i ~/.ssh/id_rsa.pub pi@10.42.1.101

原文地址:https://www.cnblogs.com/guxuanqing/p/9190930.html