CentOS6啟用金鑰登陸

2021-09-19 03:59:33 字數 688 閱讀 1604

生成秘鑰對:

ssh-keygen -t rsa
該路徑在/etc/ssh/sshd_config

rsaauthentication yes 開啟rsa驗證

pubkeyauthentication yes 是否使用公鑰驗證

authorizedkeysfile .ssh/authorized_keys 公鑰的儲存位置

passwordauthentication no 禁止使用密碼驗證登入

進入生成好的金鑰資料夾:

cd /root/.ssh
(包含兩個檔案,公鑰:id_rsa.pub用於伺服器校驗密匙使用,私鑰:id_rsa用於客戶端登陸使用)

建立秘鑰驗證檔案

touch authorized_keys
將原來的秘鑰檔案內容追加至已經建立好的新檔案中

cat id_rsa.pub >> authorized_keys
修改秘鑰檔案許可權:

chmod  600 /root/.ssh/authorized_keys
重啟服務:

service sshd restart

秘鑰登陸centos6並且修改為賬號登陸

1 建立root使用者的密碼 sudo passwd root 2 切換到root賬號 su root 3 編輯主機的ssh登入方式,查詢passwordauthentication no,把no改為yes,即允許賬號登陸 vi etc ssh sshd config 4 重啟sshd服務 sudo...

putty金鑰登陸

putty 路徑 雙擊標記中的 在彈出框中選中 rsa,2048 然後點選 generate 按鈕,滑鼠在彈出框內不斷晃動。直到出現以下內容,將標記 1中內容複製儲存並發給相關人員,然後點選標記 2,儲存自己的私鑰。登入伺服器 vi ssh authorized keys 將公鑰新增到最後 雙擊標記...

Linux Xshell 配置金鑰登陸

設定不需要密碼登陸 vim etc ssh sshd config 在配置檔案中引數的意義 pubkeyauthentication yes 啟用公告金鑰配對認證方式 authorizedkeysfile h ssh authorized keys 設定publickey檔案路徑 rsaauthen...