As ssh became my first choice for going over GFW, a auto connected ssh tunnel is badly required.
what i did for a long time is adding a application launcher whose property is set as "ssh -D port usr@host" to the panel. the tunnel will be established with one click and some pwd typing.
I googled and find EXPECT.
Step One:
$sudo apt-get install expect
Step Two:
$vim ssh //create a new script.
Step Three:
//Input in Vim#!/usr/bin/expectspwan ssh -D port usr@host;expect "*password:";send "pwd\r";interact;//{esc};:wq;{enter} to save the file.
Step Four:
$chmod +x ssh
Step Five:
./ssh
Now the script will connect to ssh server automatically without requiring the pwd.
Comments
Post a Comment