建立 public key
mkdir -p ~/.ssh chmod 700 ~/.ssh ssh-keygen
在 .ssh 下產出的
id_rsa.pub 是 public key
id_rsa 是 private key
把 id_rsa.pub 加到 /root/.ssh/authorized_keys 中即可
mkdir -p ~/.ssh chmod 700 ~/.ssh ssh-keygen
PasswordAuthentication no PubkeyAuthentication yes
systemctl restart sshd