Use server key to login Linux

if you want to login your server without password, you can try to create server key to login.
Please follow next steps:

cd ~ && mkdir .ssh

cd .ssh

ssh-keygen -t rsa // keep enter without anything


mv authorized_keys

vim /etc/ssh/sshd_config

PasswordAuthentication yes to PasswordAuthentication no

PubkeyAuthentication yes delete

AuthorizedKeysFile .ssh/authorized_keys delete

save and exit
download “id_rsa” and use PuttyGen to change to a private key

service restart sshd

then you can use that private key to login your server

Leave A Comment

Your email address will not be published. Required fields are marked *