ssh公钥验证的过程及遇到的问题

1.创建一对密钥;

2.将公钥复制并添加到~/.ssh/authorized_keys;

3.设定ssh客户端采用私钥进行登陆验证。

ssh公钥生效需满足的两个条件:
1) .ssh目录的权限必须是700 
2) .ssh/authorized_keys文件权限必须是600

ssh的man page:

FILES

~/.ssh/
This directory is the default location for all user-specific configuration and authentication information. There is no general requirement to keep the entire contents of this directory secret,but the recommended permissions are read/write/execute for the user, and not accessible by others.

~/.ssh/authorized_keys
Lists the public keys (RSA/ECDSA/DSA) that can be used for logging in as this user. The format of this file is described in the sshd(8) manual page. This file is not highly sensitive, but the recommended permissions are read/write for the user, and not accessible by others.

转载于:https://www.cnblogs.com/freedom5wind/p/7470774.html

你可能感兴趣的:(ssh公钥验证的过程及遇到的问题)