Configuring Two-Factor Login to the Server

It is best to use a non-root user for remote server two-factor login to ensure security

Mainly follow this article: https://linux.cn/article-8354-1.html

have to be aware of is:

When configuring, it is clear that if a certain user is to connect to the remote host, the operation and maintenance password must be configured in the environment of this user!

 

Example: (ubuntu 16.04)

At this point, you need to create a normal user:

useradd sshuser

change Password:

passwd sshuser

At this time, if the sshuser user does not have sudo permissions, you need to add it to the /etc/sudoers file

# User privilege specification
root    ALL=(ALL:ALL) ALL
sshuser ALL=(ALL:ALL) ALL  #这行需要添加!

At this point, if sshuser does not have a home directory, create a home directory for it

mkdir /home/sshuser
chown sshuser:sshuser /home/sshuser

To configure stable sshuser login, you need to

su sshuser
cd ~

See the above link for the installation part:

Tips: Pay attention to save the QR code

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325257688&siteId=291194637