28/10/2021

socks-connect.sh

Read Time:13 Second
#!/usr/binbash
read -p "Please input a IP: " ip1
read -p "Please input local port: "  port1

ssh -N -f -D $port1 username@$ip1 &>/dev/null

if [ $? -eq 0 ]; then
        echo "$ip1 success!"
else
        echo "$ip1 error"
fi

此脚本稍做修改保存用来使用socks上网时快速配置使用,其中:ip1设置服务器地址,port1设置服务地端口,username为登录服务器的帐号

About Post Author

Hye

天法道,道法自然。 闲逸庭前,花开花落。
administrator
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

发表评论

Previous post Gentoo bash
Next post Linux Virtualbox install MacOS