3

ssh使用密钥登录,禁止口令登录

 3 years ago
source link: http://abcdxyzk.github.io/blog/2021/06/01/ssh-auth/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ssh使用密钥登录,禁止口令登录

2021-06-01 13:56:00

http://blog.chinaunix.net/uid-8116903-id-334714.html

1、配置私钥

a、使用命令 ssh-keygen -t rsa 生成密钥

b、将公钥拷贝到远程服务器上的 /root/.ssh/authorized_keys 文件

c、客户端上保留私钥,公钥留不留都可以。也就是服务器上要有公钥,客户端上要有私钥。这样就可以实现无密码验证登录了。

2、禁止口令登录

可以修改上 /etc/ssh/sshd_conf 中的

PasswordAuthentication yes 改为
PasswordAuthentication no

也即只能使用密匙认证的openssh,禁止使用口令认证。

Posted by kk

2021-06-01 13:56:00tools, ssh

« ssh 新机器去掉提示yes/no git修改commit »


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK