Private key login, change to password login

After creating a new instance, a private key A will be generated

Use private key A to remotely log in to the server

Import private key A, the file has no format requirements

 set password

After entering passwd root, you will be prompted to enter a new password, enter a root password, and you need to enter it again for verification

passwd root

Modify the configuration file

vi /etc/ssh/sshd_config

Remove the comment before PermitRootLogin yes

#PermitRootLogin yes

 Remove the comment before PasswordAuthentication yes

#PasswordAuthentication yes

restart service

systemctl restart sshd.service

Login with password

おすすめ

転載: blog.csdn.net/qq_38312411/article/details/128799303