Under ubuntu, ordinary users are allowed to log in with SSH, and root is forbidden
1. Create a user
sudo adduser username
2. Add sudo permissions
sudo vim /etc/sudoer
修改前:
# User privilege specification
root ALL=(ALL:ALL) ALL
修改后
# User privilege specification
root ALL=(ALL:ALL) ALL
ly_1 ALL=(ALL:ALL) ALL
That is to add root privileges to your user.
3. Configure ssh
sudo vim /etc/ssh/sshd_config
修改前:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
修改后:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
PermitRootLogin yes
StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
Then you can log in as a normal user