ssh免密码登录步骤及别名设置
1. 生成本机的公私钥
ssh-keygen -t rsa
2. 将公钥复制到目标机器上
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.100
3. 设置别名登录
vim ~/.ssh/config
添加如下内容
Host 100
HostName 192.168.0.100
Port 22
User root
IdentityFile ~/.ssh/id_rsa.pub
IdentitiesOnly yes
复制代码
4. 登录
ssh 100