1. 程式人生 > >item2訪問伺服器免登入配置

item2訪問伺服器免登入配置

1.

在本地生成一個login.exp檔案,檔案內容如下:

#!/usr/bin/expect

set timeout 30

spawn ssh [lindex $argv 0]

expect {

"(yes/no)?"

{send "yes\n";exp_continue}

"password:"

{send "[lindex $argv 1]\n"}

}

interact

2.在item2做profile配置

 item2 -> preference -> profile

配置見圖:                                                                  

~

~

~

~

~

~

~