80后的细娃儿

Ubuntu SSH 密钥一键配置脚本

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

点赞

发表评论