ssh user@ip 远程登陆
ssh-keygen 生成公钥与私钥对
ssh-keygen -t [rsa|dsa] -C “any comment can be here”
-t = The type of the key to generate 密钥的类型
-C = comment to identify the key 用于识别这个密钥的注释
ssh-copy-id
ssh-copy-id -i ~/.ssh/id_rsa.pub user@server
-i: identity_file指定公钥文件
将本机公钥复制到远程机器的~/.ssh/authorized_keys中, 同时将ip加入known_hosts