lusheng (@skylusheng)vps快捷开启密钥脚本 中发帖

sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
sed -i 's/PubkeyAuthentication no/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
sudo systemctl restart ssh

已经有公钥,怎么一键导入并开启密钥登录同时关闭密码登录,我用这个执行发现不成功