linux:miwifi-shadowsocks
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux:miwifi-shadowsocks [2018/09/03 13:28] – percy | linux:miwifi-shadowsocks [2019/03/09 01:35] (current) – percy | ||
---|---|---|---|
Line 51: | Line 51: | ||
} | } | ||
</ | </ | ||
+ | |||
<code BASH> | <code BASH> | ||
/ | / | ||
/ | / | ||
+ | </ | ||
+ | |||
+ | Everytime after the router restart, it will delete the script, so I put the script to / | ||
+ | chmod +x / | ||
+ | ln -s / | ||
+ | / | ||
+ | |||
+ | |||
+ | ==== To support kcptun with shadowsocks ==== | ||
+ | |||
+ | <code BASH> | ||
+ | CONFIG_KCPTUN=/ | ||
+ | # | ||
+ | CONFIG=$CONFIG_KCPTUN | ||
+ | DNS=8.8.8.8: | ||
+ | TUNNEL_PORT=5353 | ||
+ | |||
+ | start() { | ||
+ | # Client Mode | ||
+ | # | ||
+ | # Proxy Mode | ||
+ | | ||
+ | # Tunnel | ||
+ | | ||
+ | } | ||
+ | stop() { | ||
+ | # Client Mode | ||
+ | # | ||
+ | # Proxy Mode | ||
+ | | ||
+ | # Tunnel | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | And the shadowsocks-kcptun.json | ||
+ | <code Bash> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | And it will depends on the kcptun `cat / | ||
+ | <code Bash> | ||
+ | |||
+ | #!/bin/sh | ||
+ | |||
+ | cd / | ||
+ | echo ./ | ||
+ | ./ | ||
</ | </ | ||
Line 76: | Line 133: | ||
/ | / | ||
+ | ===== ssh keys ===== | ||
+ | OpenWrt is not using ~/.ssh for the keys, and it use / | ||
+ | - https:// | ||
+ | - https:// | ||
+ | |||
+ | scp yourpubkey root@192.168.31.1:/ | ||
+ | cd / | ||
+ | cat / | ||
+ | chmod 0600 authorized_keys | ||
+ | |||
+ | Then in your local machine | ||
+ | vim ~/ | ||
+ | | ||
+ | Add the ssh host config | ||
+ | < | ||
+ | Host miwifi.com 192.168.31.1 | ||
+ | IdentityFile ~/ | ||
+ | User root | ||
+ | </ | ||
+ | Then you can use the follow ssh command to login automatically | ||
+ | ssh root@192.168.31.1 | ||
+ | |||
+ | If you want to ssh to the other server in the OpenWRT, you can also add the config file, and use -F to set the ssh config file | ||
+ | ssh -F config username@yourserver | ||
+ | ===== Remote ssh forward ===== | ||
+ | |||
+ | sh / | ||
+ | ssh root@ef.pjq.me -p 32222 | ||
+ | <code Bash> | ||
+ | cat / | ||
+ | #!/bin/bash | ||
+ | |||
+ | if [ $# = 2 ];then | ||
+ | localport=$1 | ||
+ | remoteport=$2 | ||
+ | echo ssh -gNfR ef.pjq.me: | ||
+ | ssh -F / | ||
+ | #echo autossh -f -M 2" | ||
+ | #autossh -f -M 2" | ||
+ | echo DONE, Now you can visit it via | ||
+ | echo http:// | ||
+ | else | ||
+ | cat <<EOF | ||
+ | Usage: | ||
+ | ./$0 localport remoteport | ||
+ | For example, forward the localhost port 80 to the remote server 8080 | ||
+ | ssh -gNfR ef.pjq.me: | ||
+ | Then, you can visit it via: http:// | ||
+ | EOF | ||
+ | |||
+ | fi | ||
+ | </ | ||
===== Reference ===== | ===== Reference ===== | ||
Line 81: | Line 190: | ||
- http:// | - http:// | ||
- https:// | - https:// | ||
+ | - http:// | ||
/var/www/dokuwiki/wiki/data/pages/linux/miwifi-shadowsocks.txt · Last modified: 2019/03/09 01:35 by percy