1. 程式人生 > >ssh公鑰驗證的過程及遇到的問題

ssh公鑰驗證的過程及遇到的問題

log read lis not oca 進行 rect access com

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.

ssh公鑰驗證的過程及遇到的問題