仝 tóng

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

ff8378ecdce2459abf4114599feddf99_view.png

mv id_rsa.pub authorized_keys

vim /etc/ssh/sshd_config

change
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

发表新评论