1.修改一下root密码
passwd root
2.enable 22
9 apt-get install ufw
10 apt-get update
11 apt-get install ufw
12 ufw enable
13 ufw allow 22
其实不需要,,,有邮件,以及控制面板里有默认root密码,
3.d登录root
ssh [email protected]
参考:https://blog.csdn.net/weixin_34508986/article/details/111981865
4.添加普通用户
ls
useradd -r -m -s /bin/bash git
passwd git
5.添加sudoer
1.切换到root
su root
2.打开suduers文件
gedit /etc/sudoers
3.找到下面这一行,
# User privilege specification
root ALL=(ALL:ALL) ALL
4.将root那行复制一下,用户名改成要增加sudo权限的用户名,比如:
# User privilege specification
root ALL=(ALL:ALL) ALL
jason ALL=(ALL:ALL) ALL
5.保存退出即可