Linux 创建公共密钥

本文发布时间: 2019-Mar-21
[[email protected]_rac_one:/app/oracle11g]# su - grid[[email protected]_rac_one:~]# /usr/bin/ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_rsa):Created directory '/home/grid/.ssh'.Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_rsa.Your public key has been saved in /home/grid/.ssh/id_rsa.pub.The key fingerprint is:34:7e:94:d4:fa:2f:1e:99:15:a5:8c:34:db:6e:a8:e9 [email protected]_rac_one[[email protected]_rac_one:~]# /usr/bin/ssh-keygen -t dsaGenerating public/private dsa key pair.Enter file in which to save the key (/home/grid/.ssh/id_dsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /home/grid/.ssh/id_dsa.Your public key has been saved in /home/grid/.ssh/id_dsa.pub.The key fingerprint is:6b:ed:9d:56:96:fa:71:ab:12:4f:36:39:ed:3a:49:70 [email protected]_rac_one以上操作各节点都需执行.[[email protected]_rac_one:~]# ssh t_rac_one cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 't_rac_one (10.1.112.193)' can't be established.RSA key fingerprint is 28:0c:5f:b0:3b:1a:8d:50:62:47:8d:d1:a7:bd:7a:03.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 't_rac_one,10.1.112.193' (RSA) to the list of known hosts.Password:[[email protected]_rac_one:~]#[[email protected]_rac_one:~]# ssh t_rac_two cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keysThe authenticity of host 't_rac_two (10.1.112.194)' can't be established.RSA key fingerprint is 28:0c:5f:b0:3b:1a:8d:50:62:47:8d:d1:a7:bd:7a:03.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 't_rac_two,10.1.112.194' (RSA) to the list of known hosts.Password:分发公共密钥到各节点:[[email protected]_rac_one:~]# scp ~/.ssh/authorized_keys t_rac_one:.ssh/authorized_keysauthorized_keys 100% 792 0.8KB/s 00:00[[email protected]_rac_one:~]# scp ~/.ssh/authorized_keys t_rac_two:.ssh/authorized_keysPassword:authorized_keys 100% 792 0.8KB/s 00:00[[email protected]_rac_one:~]# ssh t_rac_two


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2020-Jul-13 01:11am
栏目列表