linux免密钥登陆

免密钥登陆

Quick Start

生成了私钥 id_dsa 和公钥 id_dsa.pub

1
$ sudo apt install openssh-server
1
$ ssh-keygen -t rsa

将该密钥用作认证,进行访问授权

1
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

登陆

1
$ ssh localhost