sudo vim /etc/sysconfig/network
HOSTNAME=yourname //在这修改hostname
ssh-keygen
ssh-copy-id -i /root/.ssh/id_rsa.pub root@server-01
最重要的一步,不要忘记设置权限
chmod 644 authorized_keys
sudo vim /etc/sysconfig/network
HOSTNAME=yourname //在这修改hostname
ssh-keygen
ssh-copy-id -i /root/.ssh/id_rsa.pub root@server-01