# xshell linux ssh登陸設置
xshell版本6
#### 生成密鑰對
使用xshell生成密鑰:
在屬性-》用戶身份驗證-》生成。
公鑰會提示你保存
密鑰在目錄:
C:\Users\86135\Documents\NetSarang Computer\6\SECSH\UserKeys
#### 拷貝公鑰到需要登陸的服務器
使用rz命令復制公鑰到服務器的/root/.shh下面
#### 添加公鑰到authorized_keys 文件中
cd /root/.shh
cat id_rsa_2048.pub >> authorized_keys
#### 登陸
選擇使用public Key登陸。選擇保存用戶名以及私鑰密碼可實現免密登陸。
#### 取消密碼登陸權限
vi /etc/ssh/sshd_config
修改下面內容
```
#禁用密碼驗證
PasswordAuthentication no
#啟用密鑰驗證
RSAAuthentication yes
PubkeyAuthentication yes
```
參考資料
https://www.cnblogs.com/JohnABC/p/4001383.html
原文地址
http://note.youdao.com/noteshare?id=cc9406e06fd578f461ff0e7c368f1d5c&sub=475A6607BFB949EDBD089D124B53D178