- 常用软件安装
sudo apt update
sudo apt install vim tmux proxychains git curl hugo -y
sudo apt upgrade
- SSH安装与配置
- 安装ssh服务并设置开机自启
sudo apt update
sudo apt install ssh -y
sudo systemctl enable ssh
sudo systemctl start ssh
sudo systemctl status ssh
- SSH免密登录
生成SSH公私钥, 将pub内容追加写入到 authorized_keys
ssh-keygen -t rsa
#touch ~/.ssh/authorized_keys
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
- sshd_config配置
编辑 /etc/ssh/sshd_config 文件,
sudo vim /etc/ssh/sshd_config
进行以下配置,注意路径:
PubkeyAuthentication yes
AuthorizedKeysFile /home/torrk/.ssh/authorized_keys
可以通过禁用密码登录提高安全性
PasswordAuthentication no
评论