AWS server, how to set as password login

The company has always had an AWS server, but every time an instance is launched, it is logged in with a secret key. Write an article here to explain how to change the secret key login server to password login.

1. In the new server, create a password for the root account. Use the command

sudo passwd root

Follow the steps to set up

2. After the setting is complete, use the root user identity:

su root

Enter the password you just created.

3. Find and edit the sshd_config file

The general path is in /etc/ssh/sshd_config

vim /etc/ssh/sshd_config

4. Find the following options and modify them.

PasswordAuthentication no =》 Change no to yes

PermitRootLogin =》改成 PermitRootLogin yes

5. After saving the changes, restart the ssh service

sudo service sshd restart

Then go and see if you can log in with a password.

Feel the reading of the old iron. Thank you, do not get lost if you like and follow with your little hands.

Guess you like

Origin blog.csdn.net/u012798683/article/details/112356066