标签 密匙 下的文章

linux SSH单用户密钥登陆

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/test/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/test/.ssh/id_rsa.
Your public key has been saved in /home/test/.ssh/id_rsa.pub.
The key fingerprint is:15:b0:02:35:b4:0d:d3:fe:9c:e8:56:e1:a6:06:8c:e9 test@asianux3

创建密钥。

然后拷贝公钥到服务器上:将.ssh/id_rsa.pub 上传到服务器并且重命名 ~/.ssh/authorized_keys  

设置权限600.