ssh登录远程server

1.本地生成ssh

ssh-keygen -t rsa

2.将生成的sshkey上传到remote server

cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'

3.本地配置ssh config,快速登录

Host me
    hostname lvsmart.me
    port	22
    user root
    identityfile ~/.ssh/id_rsa

你可能感兴趣的:(server,ssh,key)