Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1722907
  • 博文数量: 150
  • 博客积分: 660
  • 博客等级: 上士
  • 技术积分: 2480
  • 用 户 组: 普通用户
  • 注册时间: 2005-08-08 11:39
文章分类

全部博文(150)

文章存档

2019年(4)

2018年(36)

2017年(53)

2016年(7)

2015年(3)

2014年(3)

2013年(27)

2012年(2)

2011年(1)

2006年(1)

2005年(13)

分类: 网络与安全

2017-08-29 14:53:04

如何建立ssserver端

环境

centos7.3

安装步骤

软件安装

安装python工具

yum install python-setuptools && easy_install pip
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
epel                                                                                                                                                                    | 4.3 kB  00:00:00
extras                                                                                                                                                                  | 3.4 kB  00:00:00
os                                                                                                                                                                      | 3.6 kB  00:00:00
updates                                                                                                                                                                 | 3.4 kB  00:00:00
zabbix                                                                                                                                                                  |  951 B  00:00:00
zabbix-non-supported                                                                                                                                                    |  951 B  00:00:00
(1/3): epel/7/x86_64/group_gz                                                                                                                                           | 170 kB  00:00:00
(2/3): epel/7/x86_64/updateinfo                                                                                                                                         | 816 kB  00:00:00
(3/3): epel/7/x86_64/primary_db                                                                                                                                         | 4.8 MB  00:00:00
Determining fastest mirrors
Resolving Dependencies
--> Running transaction check
---> Package python-setuptools.noarch 0:0.9.8-4.el7 will be installed
--> Processing Dependency: python-backports-ssl_match_hostname for package: python-setuptools-0.9.8-4.el7.noarch
--> Running transaction check
---> Package python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7 will be installed
--> Processing Dependency: python-backports for package: python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch
--> Running transaction check
---> Package python-backports.x86_64 0:1.0-8.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================================================================
 Package                                                            Arch                                  Version                                      Repository                         Size
===============================================================================================================================================================================================
Installing:
 python-setuptools                                                  noarch                                0.9.8-4.el7                                  os                                396 k
Installing for dependencies:
 python-backports                                                   x86_64                                1.0-8.el7                                    os                                5.8 k
 python-backports-ssl_match_hostname                                noarch                                3.4.0.2-4.el7                                os                                 12 k

Transaction Summary
===============================================================================================================================================================================================
Install  1 Package (+2 Dependent packages)

Total download size: 414 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): python-backports-1.0-8.el7.x86_64.rpm                                                                                                                            | 5.8 kB  00:00:00
(2/3): python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch.rpm                                                                                                     |  12 kB  00:00:00
(3/3): python-setuptools-0.9.8-4.el7.noarch.rpm                                                                                                                         | 396 kB  00:00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                          4.1 MB/s | 414 kB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python-backports-1.0-8.el7.x86_64                                                                                                                                           1/3
  Installing : python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch                                                                                                                    2/3
  Installing : python-setuptools-0.9.8-4.el7.noarch                                                                                                                                        3/3
  Verifying  : python-setuptools-0.9.8-4.el7.noarch                                                                                                                                        1/3
  Verifying  : python-backports-1.0-8.el7.x86_64                                                                                                                                           2/3
  Verifying  : python-backports-ssl_match_hostname-3.4.0.2-4.el7.noarch                                                                                                                    3/3

Installed:
  python-setuptools.noarch 0:0.9.8-4.el7

Dependency Installed:
  python-backports.x86_64 0:1.0-8.el7                                                python-backports-ssl_match_hostname.noarch 0:3.4.0.2-4.el7

Complete!

安装ss

pip install shadowsocks
Searching for pip
Reading 
Best match: pip 9.0.1
Downloading 
Processing pip-9.0.1.tar.gz
Writing /tmp/easy_install-Z0QGGZ/pip-9.0.1/setup.cfg
Running pip-9.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Z0QGGZ/pip-9.0.1/egg-dist-tmp-vT1TA6
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
  warnings.warn(msg)
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.mailmap'
warning: no previously-included files found matching '.travis.yml'
warning: no previously-included files found matching '.landscape.yml'
warning: no previously-included files found matching 'pip/_vendor/Makefile'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files found matching 'dev-requirements.txt'
warning: no previously-included files found matching 'appveyor.yml'
no previously-included directories found matching '.github'
no previously-included directories found matching '.travis'
no previously-included directories found matching 'docs/_build'

编辑生成配置文件

vi /etc/shadowsocks.json
{
    "server":"your server ip",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": true
}

打开fast tcp 的系统开关

echo 3 > /proc/sys/net/ipv4/tcp_fastopen

运行测试

ssserver -c /etc/shadowsocks.json

作为后台服务启动

ssserver -c /etc/shadowsocks.json -d start

关闭命令

ssserver -c /etc/shadowsocks.json -d stop

服务日志

/var/log/shadowsocks.log

参考

阅读(2841) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~