手动搭建ShadowsocksR服务器

系统环境:Debian 9.4 amd64


  先从GitHub上获取项目源码

root@debian:~# wget https://github.com/shadowsocksrr/shadowsocksr/archive/3.2.2.tar.gz

  解压下载下来的压缩包

root@debian:~# tar -xvf 3.2.2.tar.gz

  查看当前目录下的文件

root@debian:~# ls
3.2.2.tar.gz  shadowsocksr-3.2.2

  进入ssr目录

root@debian:~# cd shadowsocksr-3.2.2/

  初始化配置

root@debian:~/shadowsocksr-3.2.2# ./initcfg.sh

  打开并修改配置文件(主要是修改端口和密码)

root@debian:~/shadowsocksr-3.2.2# vi user-config.json
{
    "server": "0.0.0.0",
    "server_ipv6": "::",
    "local_address": "127.0.0.1",
    "local_port": 1080,

    "port_password": {
        "12321":"password1",
        "23432":"password2"
    },

    "method": "aes-128-ctr",
    "protocol": "auth_aes128_md5",
    "protocol_param": "",
    "obfs": "tls1.2_ticket_auth_compatible",
    "obfs_param": "",
    "speed_limit_per_con": 0,
    "speed_limit_per_user": 0,

    "additional_ports" : {}, // only works under multi-user mode
    "additional_ports_only" : false, // only works under multi-user mode
    "timeout": 120,
    "udp_timeout": 60,
    "dns_ipv6": false,
    "connect_verbose_info": 0,
    "redirect": "",
    "fast_open": false
}

  接着再进入shadowsocks子目录

root@debian:~/shadowsocksr-3.2.2# cd shadowsocks/

  赋予脚本执行权限

root@debian:~/shadowsocksr-3.2.2/shadowsocks# chmod +x *.sh

  启动服务

root@debian:~/shadowsocksr-3.2.2/shadowsocks# ./run.sh

  查看上面配置的端口是否处于监听状态

root@debian:~/shadowsocksr-3.2.2/shadowsocks# netstat -lnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      684/sshd            
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      817/sshd: root@pts/ 
tcp6       0      0 :::22                   :::*                    LISTEN      684/sshd            
tcp6       0      0 ::1:6010                :::*                    LISTEN      817/sshd: root@pts/ 
tcp6       0      0 :::12321                :::*                    LISTEN      9260/python3.5      
tcp6       0      0 :::23432                :::*                    LISTEN      9260/python3.5      
udp        0      0 0.0.0.0:68              0.0.0.0:*                           416/dhclient        
udp6       0      0 :::12321                :::*                                9260/python3.5      
udp6       0      0 :::23432                :::*                                9260/python3.5 

  本地客户端配置好服务器信息
这里写图片描述

启动代理后打开浏览器访问谷歌进行测试
这里写图片描述

猜你喜欢

转载自blog.csdn.net/Dyminas/article/details/80724669
今日推荐