bash
ssh-keygen -R ip
bash
apt update
apt upgrade -y
bash
vim /etc/ssh/sshd_config
找到port 更改
sudo service sshd restart 重启
ssh root@ip -p 端口号
bash
passwd
adduser taosu
bash
apt update && apt install sudo
visudo
#在root all.....下一行加
taosu ALL=(ALL) NOPASSWD: ALL
#禁止root登陆
vim /etc/ssh/sshd_config
#找到 PermitRootLogin Yes 这一项,然后把它后面的设定值改为 no
sudo service sshd restart
sudo apt install net-tools
sudo apt-get install ufw
sudo ufw allow 22
bash
ufw status
ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow http
sudo ufw allow https
sudo ufw enable