ssh代理on linux
ssh代理on linux
ssh代理on linux
ssh 保持连接:
www.2cto.com
修改 /etc/ssh/ssh_config
1
TCPKeepAlive yes
2
# 60s 发送一个数据包,网上很多都用300,发现对我这个还是太长了
3
ServerAliveInterval 60
ssh 自动登陆:
编辑脚本ssh,内容如下
www.2cto.com
1
#!/usr/bin/expect -f
2
3
# 开始ssh连接,3秒后发送密码
4
set timeout 3
5
spawn ssh -qTfnN -D 7070 -p 443 YOURNAME@YOURSERVER
6
expect "*assword:*"
7
8
send "YOURPASS\r"
9
expect eof
执行脚本,expect ssh
评论暂时关闭