Skip to content

Instantly share code, notes, and snippets.

@gnepud
Last active April 30, 2018 20:42
Show Gist options
  • Save gnepud/382aeeeaea7a062926d5 to your computer and use it in GitHub Desktop.
Save gnepud/382aeeeaea7a062926d5 to your computer and use it in GitHub Desktop.
shadowsocks / ssh proxy
----- shadowsocks ------
server
easy_install pip
pip install shadowsocks
vi /etc/shadowsocks.json
{
"server":"server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"password",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false
}
ssserver -c /etc/shadowsocks.json -d start
ssserver -c /etc/shadowsocks.json -d stop
client Mac
brew install shadowsocks-libev
vi /usr/local/etc/shadowsocks-libev.json
{
"server":"server_id",
"server_port":8388,
"local_port":1080,
"password":"password",
"timeout":600,
"method":"aes-256-cfb"
}
/usr/local/opt/shadowsocks-libev/bin/ss-local -c /usr/local/etc/shadowsocks-libev.json
tunnel for forward port
install https://github.com/shadowsocks/shadowsocks-libev
vim /etc/shadowsocks-libev/config.json
{
"server":"remote_ssserver_id",
"server_port":remote_ssserver_port,
"local_address":"local_server_id",
"local_port":local_server_any_port,
"password":"password",
"timeout":300,
"method":"aes-256-cfb"
}
ss-tunnel -c /etc/shadowsocks-libev/config.json -L remote_server_id:remote_server_any_port
SwitchyOmega
set proxy to localhost:1080
------- SSH proxy --------
ssh -qTnN -D <local-port> <remote-server>
-q :- be very quite, we are acting only as a tunnel.
-T :- Do not allocate a pseudo tty, we are only acting a tunnel.
-f :- move the ssh process to background, as we don’t want to interact with this ssh session directly.
-N :- Do not execute remote command.
-n :- redirect standard input to /dev/null.
SSH forward port
ssh -L local_binding_ip:local_any_port:remote_server_id:remote_server_any_port root@remote_server_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment