shadowsocks搭建

来源:互联网 发布:qt windows 安装 编辑:程序博客网 时间:2024/04/27 17:16

Ubuntu环境
更新软件源:

apt-get update

安装pip环境

apt-get install python-pip

安装shadowsocks

pip install shadowsocks

如果提示版本过低则按提示更新
创建配置文件

vim /etc/shadowsocks.json

添加

{    "server":"my_server_ip",    "server_port":8388,//默认是8388,如果不行可更改    "local_address": "127.0.0.1",    "local_port":1080,    "password":"mypassword",    "timeout":300,    "method":"aes-256-cfb"}
name info server 服务器 IP (IPv4/IPv6),注意这也将是服务端监听的 IP 地址 server_port 服务器端口 local_port 本地端端口 password 用来加密的密码 timeout 超时时间(秒) method 加密方法,可选择 “bf-cfb”, “aes-256-cfb”, “des-cfb”, “rc4″, 等等。默认是一种不安全的加密,推荐用 “aes-256-cfb”

备注:如要你需要分享SS服务给朋友或家人,可以配置多个SS账户,具体可以参考下面的代码。

{"server":"your_server_ip","port_password":{     "8381":"pass1",     "8382":"pass2",     "8383":"pass3",     "8384":"pass4"     },"timeout":60,"method":"rc4-md5","fast_open":false,"workers":1}

赋予文件权限
chmod 755 /etc/shadowsocks.json
安装以支持这些加密方式
apt–get install python–m2crypto
后台运行
ssserver -c /etc/shadowsocks.json -d start
停止命令:
ssserver -c /etc/shadowsocks.json -d stop
设置开机自启动

vim /etc/rc.local

加上如下命令:

#!/bin/sh -e## rc.local## This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.ssserver -c /etc/shadowsocks.json -d startexit 0

Centos环境
安装shadowsocks

yum install python-setuptools && easy_install pippip install shadowsocks

其他步骤大致相同

参照相关文档
搭建自己的Shadowsocks服务器

原创粉丝点击