ubuntuでは、通常のユーザーはSSHでログインでき、rootは禁止されています

ubuntuでは、通常のユーザーはSSHでログインでき、rootは禁止されています

1.ユーザーを作成します

sudo adduser username

2.sudo権限を追加します

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

これは、root権限をユーザーに追加することです。

3.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

その後、通常のユーザーとしてログインできます

おすすめ

転載: blog.csdn.net/qq_45125250/article/details/110313489