1.ssh-keygen -t rsa
一路回车
2.在/root/.ssh/目录下会出现id_rsa(私钥)和id_rsa.pub(公钥)文件,把公钥内容复制到文件authorized_keys文件中:
cat id_rsa.pub > authorized_keys
1.ssh-keygen -t rsa
一路回车
2.在/root/.ssh/目录下会出现id_rsa(私钥)和id_rsa.pub(公钥)文件,把公钥内容复制到文件authorized_keys文件中:
cat id_rsa.pub > authorized_keys