鍍金池/ 問答/Linux/ 通過xshell登錄服務器,每次都需要輸入同樣的命令和密碼,有沒有辦法設置自動輸

通過xshell登錄服務器,每次都需要輸入同樣的命令和密碼,有沒有辦法設置自動輸入?

通過xshell登錄服務器,每次都需要輸入同樣的命令和密碼,有沒有辦法設置自動輸入?

回答
編輯回答
安若晴

Change the ssh authorized way of your server to PubkeyAuthentication.

Check out this:
http://www.xshell.net/linux/x...
http://www.aiezu.com/system/l...

2018年8月18日 10:35
編輯回答
傲嬌范

xshll 不是可以保存服務器信息么-.- 保存起來下次一鍵鏈接啊

2017年11月9日 08:40
編輯回答
冷眸

你可以寫個expect的shell腳本,來自動連接。

#!/usr/bin/expect -f
set user root
set host yourhost
set password yourpassword
set timeout -1

spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof
2017年9月28日 03:58
編輯回答
尤禮

可以通過 ssh-keygen 生成秘鑰對,把公鑰傳到服務器上 用秘鑰登錄
xshell 正常密碼也可以記錄的吧

2017年12月14日 15:49