生成認證key 私鑰(鑰匙) 公鑰(鎖) 加密伺服器 存在於 代表加密完成 分發密鑰 ...
# info
# CentOS 7.3 64位
生成認證key
ssh-keygen
Generating public/private rsa key pair. # 指定保存加密字元的文件(使用預設) Enter file in which to save the key Created directory '/home/USERNAME/.ssh'. # 設定密碼(使用預設空密碼) Enter passphrase (empty for no passphrase): # 確認密碼 Enter same passphrase again: Your identification has been saved in /home/USERNAME/.ssh/id_rsa. Your public key has been saved in /home/USERNAME/.ssh/id_rsa.pub. The key fingerprint is: ※※※
/home/USERNAME/.ssh/id_rsa
私鑰(鑰匙)
/home/USERNAME/.ssh/id_rsa.pub
公鑰(鎖)加密伺服器
ssh-copy-id -i /home/USERNAME/.ssh/id_rsa.pub [email protected]
Now try logging into the machine, with: "ssh '[email protected]'" and check to make sure that only the key(s) you wanted were added.
authorized_keys
存在於/home/USERNAME/.ssh/
代表加密完成分發密鑰
scp [email protected]:/home/USERNAME/.ssh/id_rsa ~/.ssh/