Ubuntu SSH 密钥一键配置脚本

1,358次阅读
没有评论

mkdir -p ~/.ssh
curl -fsSL https://github.com/GITHUB 用户名.keys >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
cp /etc/ssh/sshd_config /etc/ssh/sshd_config_bak
sudo sed -i “s@.*\(PasswordAuthentication \).*@\1no@” /etc/ssh/sshd_config
sudo service sshd restart

正文完
 0
评论(没有评论)
验证码