一起来搞机3:搭建SS服务器

来源:互联网 发布:淘宝怎么发链接充话费 编辑:程序博客网 时间:2024/05/17 06:03

这次要搭比较热门和实用的SS服务器,用于Google一下,我就知道。


SS服务器,对于我来说是个翻墙和加速的神器,配置和搭建都简单,而且效果还挺好的。有时要上github或者stackoverflow.com要等半年页面才出来,挂个SS,速度就爽多了。我用广东电信线路ping搬瓦工也170ms,对于浏览网页的需求绝对够了。



搭建Shadowsocks服务器
安装python-setuptools工具

[root@localhost ~]# yum install python-setuptools -y


安装pip工具

[root@localhost ~]# easy_install pip


安装ss服务

[root@localhost ~]# pip install shadowsocks


编辑ss的配置文件

[root@localhost ~]# vi /etc/shadowsocks.json

{
    "server":"0.0.0.0",
    "server_port":监听端口,
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"密码",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open":false
}

保存退出


尝试启动,测试是否翻墙成功

[root@localhost ~]# ssserver -c /etc/shadowsocks.json
INFO: loading config from /etc/shadowsocks.json
2017-01-12 22:39:25 INFO loading libcrypto from libcrypto.so.10
2017-01-12 22:39:25 INFO starting server at 0.0.0.0:10443

可以看到启动成功,并在监听端口10443,配置好客户端,尝试访问www.google.com,成功访问即搭建成功


后台运行ss

[root@localhost ~]# ssserver -c /etc/shadowsocks.json > /var/log/shadowsocks.log 2>&1 &


错误日志将会放在

/var/log/shadowsocks.log


查看ss是否运行着

[root@localhost ~]# ps -ef | grep ssserver
root 504 363 0 22:59 pts/0 00:00:00 /usr/bin/python /usr/bin/ssserver -c /etc/shadowsocks.json


查到代表运行着
关闭后台ss

[root@localhost ~]# killall ssserver


开机启动ss
编辑/etc/rc.local

[root@localhost ~]# vi /etc/rc.local


在末尾新开一行

ssserver -c /etc/shadowsocks.json > /var/log/shadowsocks.log 2>&1 &

保存退出,重启服务器查看是否启动成功即可


原创作品,如有雷同,当我抄你。

0 0
原创粉丝点击