两种加密算法:
RSA (R. Rivest, A. Shamir, L. Adleman are the originators)
DSA (digital signature algorithm)
1. 建立密钥:
ssh-keygen -t rsa -C “wuchen@ihep.ac.cn”
2. 拷贝你的公钥到远程服务器上

scp .ssh/id_rsa.pub remote_usrname@remote_host:

mkdir ~/.ssh
mv ~/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
注意在服务器主机名后面的 : 。这种方式文件会被复制到规程主机的默认的/home/remote_usrname目录下
另一种方法
ssh-copy-id -i .ssh/id_rsa.pub mith@metawire.org
3.记住你的“密码短句”
ssh-agent(OpenSS自带)
ssh-add ~/.ssh/id_rsa
4.对于github和bitkbucket:
xclip -sel clip < ~/.ssh/id_rsa.pub
然后粘贴到Add Key里
注意:rsa key要放在标准目录下
关于ssh密钥
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *