ssh登录方式
- 口令登录
- 密钥认证
密钥登录
- 生成密钥
ssh-keygen -t rsa
- 上传密钥
ssh-copy-id -i ~/.ssh/id_rsa.pub user@ip
# window下
scp .ssh/id_rsa.pub username@remote:~/.ssh/authorized_keys
- 密钥登录
ssh user@ip
- 别名登录
# 本地~/.ssh/config添加
Host 别名
HostName ip
User root