SSH 登录安全又方便,但是输密码很不方便,本文记录密钥SSH登录的方法流程。
ssh-keygen
id_rsa
, id_rsa.pub
Linux 下在
~/.ssh
文件夹 Windows 在C:/Users/Administrator/.ssh/
目录下
id_rsa.pub
authorized_keys
中.ssh
文件夹下编辑 config
文件Host omv
HostName 192.168.1.111
User vvd
Port 22
IdentityFile ~\.ssh\id_rsa
IdentitiesOnly yes
$ ssh omv
Linux omv 5.10.0-0.bpo.9-amd64 #1 SMP Debian 5.10.70-1~bpo10+1 (2021-10-10) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Feb 8 23:20:25 2022 from 192.168.1.4
vvd@omv:~$