ssh远程登录 CentOS 7

2018-12-10  本文已影响0人  农村高富帅

前言

开始

vim /etc/ssh/sshd_config
RSAAuthentication yes  
PubkeyAuthentication yes
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
chmod 700 .ssh
chmod 600 .ssh/authorized_keys
systemctl start sshd.service
systemctl enable sshd.service
ssh -l 0.0.0.0

免密登录

ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /home/linden.guo/.ssh/id_rsa (生成私钥与公钥存放位置)
Enter passphrase (empty for no passphrase): 输入密码
Enter same passphrase again:再次输入密码
Your identification has been saved in /home/linden.guo/.ssh/id_rsa.    (生成的私钥)
Your public key has been saved in /home/linden.guo/.ssh/id_rsa.pub. (生成的公钥)
The key fingerprint is:
76:04:4d:44:25:37:0f:b1:a5:b7:6e:63:d4:97:22:6b root@usousou192_168_0_21
systemctl restart sshd.service
ssh root@0,0,0,0

结束

上一篇 下一篇

猜你喜欢

热点阅读