Linux login using ssh public key

linux login:
1. password: insecure
firewall configuration filter IP: trouble
2, ssh private key Login Login:
GitHub principle:
Client: SSH-keygen -t rsa, client generates public and private keys in root /. ssh /
Write pictures described here

The last public service side
scp id_rsa.pub [email protected]: / root
Write pictures described here
Server end: a public key stored in the directory under which user is using which user logs
mkdir .ssh
CAT id_rsa.pub >> / root /. SSH / the authorized_keys
the chmod 600 the authorized_keys
off SELinux service: vi / etc / selinux / config , the SELINUX = disabled, restart the server

Turn off password authentication:
Modify ssh server configuration file: cd / etc / ssh
vi sshd_config:
RSAAuthentication yes: open rsa verify
PubkeyAuthentication yes: whether to use public
AuthorizedKeysFile .ssh / authorized_keys: public save location
PasswordAuthentication no: prohibit the use of password

sshd restart Service
SSH [email protected]: Log
Write pictures described here

Linux using the private key, widnow direct connection, xshell direct connection:
Write pictures described here

Published 53 original articles · won praise 55 · Views 100,000 +

Guess you like

Origin blog.csdn.net/dreams_deng/article/details/78968416