我只有一台安装了 Ubuntu 的 PC,但我必须练习 SSH。有人能帮我吗,我该怎么做?
谢谢。
答案1
答案2
定义 ssh 密钥(用于主服务器和从服务器之间的通信):
`ssh-keygen -t rsa` (Use empty responses for each prompt)
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in: `/home/user-name/.ssh/id_rsa`
Your public key has been saved in `/home/user-name/.ssh/id_rsa.pub`
`cd /home/user-name/.ssh`
`cp id_rsa.pub authorized_keys`
注意:需要将authorized_keys文件复制到各个节点对应的.ssh文件夹中。
然后你就完成了。ssh localhost