1.在免密登陆的客户端机器上执行ssh-keygen创建公钥,一直回车
[root@localhost ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: d8:f3:ff:e9:85:b2:5b:27:21:33:b3:0f:c2:e0:7b:98 root@localhost.localdomain The key's randomart image is: +--[ RSA 2048]----+ | | | | | | | o | | . S = . | | . = * o | | .o+ + + o| | E..o * = | | .. ++= | +-----------------+ [root@localhost ~]# cd .ssh
|
2.将公钥authorized_keys拷贝到免密登陆的目标机器上
|
[root@localhost .ssh]# scp authorized_keys root@目标机器ip:~/.ssh/
|
773

被折叠的 条评论
为什么被折叠?



