微慑信息网

linux系统中安装部署shadowsocks[20190509update]

#首先apt-get update&apt-get upgrade
1.

apt-get install python-pip

apt-get install python-pip python-m2crypto supervisor
2.
pip install shadowsocks

/**

如果该处出现问题,如下:

Downloading/unpacking shadowsocks
  Cannot fetch index base URL http://pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement shadowsocks
No distributions at all found for shadowsocks
Storing complete log in /root/.pip/pip.log
root@BareKnowledgeable-VM:~# pip install shadowsocks -i http://e.pypi.python.org/simple
Downloading/unpacking shadowsocks
  Cannot fetch index base URL http://e.pypi.python.org/simple/
  Could not find any downloads that satisfy the requirement shadowsocks
No distributions at all found for shadowsocks
Storing complete log in /root/.pip/pip.log

请尝试:

pip install shadowsocks -i https://pypi.python.org/simple/

 

因为模式pip 是http://pypi.python.org/simple/

**/
3.

配置shadowsocks服务端:

在 /etc目录下创建 shadowsocks.json 文件,将下面的内容放进去:

{

"server":"my_server_ip",

"server_port":8388,

"local_address": "127.0.0.1",

"local_port":1080,

"password":"mypassword",

"timeout":300,

"method":"aes-256-cfb",

"fast_open": false,

"workers": 1

}

 

 

4.

然后启动运行 shadowsocks服务器端:

ssserver -c /etc/shadowsocks.json

5.
添加到启动项:
/etc/supervisor/conf.d/shadowsocks.conf 或/etc/supervisor/supervisord.conf

增加下面的内容:

[program:shadowsocks]

command=ssserver -c /etc/shadowsocks.json

autorestart=true

user=nobody

并在 /etc/default/supervisor 文件的后面加入下面的一行内容: //本文来自安云网

ulimit -n 51200

接着运行命令,启动supervisor:

service supervisor start

supervisorctl reload

sudo vi /etc/rc.local
在这个配置文件的exit 0前面一行加上

service supervisor start

保存。
看你是否配置成功你可以在现在关机重启之后直接打开浏览器看是否代理成功 //

 


你可能会遇到:(2.8.2版本)

019-05-09 11:03:54 INFO     loading libcrypto from libcrypto.so.1.1
Traceback (most recent call last):
  File "/usr/local/bin/ssserver", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/server.py", line 34, in main
    config = shell.get_config(False)
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/shell.py", line 262, in get_config
    check_config(config, is_local)
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/shell.py", line 124, in check_config
    encrypt.try_cipher(config['password'], config['method'])
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/encrypt.py", line 44, in try_cipher
    Encryptor(key, method)
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/encrypt.py", line 83, in __init__
    random_string(self._method_info[1]))
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/encrypt.py", line 109, in get_cipher
    return m[2](method, key, iv, op)
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py", line 76, in __init__
    load_openssl()

 

修改方法:

(1)用vim打开文件:vim /usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py (该路径请根据自己的系统情况自行修改,如果不知道该文件在哪里的话,可以使用find命令查找文件位置)
跳转到52行(shadowsocks2.8.2版本,其他版本搜索一下cleanup)
进入编辑模式
(2)将第52行libcrypto.EVP_CIPHER_CTX_cleanup.argtypes = (c_void_p,)
改为libcrypto.EVP_CIPHER_CTX_reset.argtypes = (c_void_p,)
(3)再次搜索cleanup(全文件共2处,此处位于111行),将libcrypto.EVP_CIPHER_CTX_cleanup(self._ctx)
改为libcrypto.EVP_CIPHER_CTX_reset(self._ctx)
保存并退出
启动shadowsocks服务:service shadowsocks start 或 sslocal -c ss配置文件目录
问题解决

赞(0) 打赏
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » linux系统中安装部署shadowsocks[20190509update]

评论 抢沙发

微慑信息网 专注工匠精神

微慑信息网-VulSee.com-关注前沿安全态势,聚合网络安全漏洞信息,分享安全文档案例

访问我们联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

登录

找回密码

注册