Ubuntu安装ss快速指南

环境变量

Ubuntu 18.04, Python 3.6.6

安装步骤

  1. 安装python环境, 这里使用pyenv,路径是~/.pyenv
  2. 基于pip 安装ss

    pip install shadowsocks

  3. 创建ss.json

    vim /etc/ss.json

    编辑其中的内容如下:

    {
        "server": "xx.xx.183.152",
        "server_port":23414,
        "password":"xxxxx",
        "method":"aes-256-cfb"
    }

    4.启动ss

    ssserver -c /etc/ss.json -d start
    sslocal -c /etc/ss.json -d start

运行输出的信息如下:

INFO: loading config from /etc/ss.json
2018-08-11 21:21:38 INFO     loading libcrypto from libcrypto.so.1.1
started

安装过程中的问题

  1. 启动过程中的问题错误:
INFO: loading config from /etc/ss.json
2018-08-11 20:53:38 INFO     loading libcrypto from libcrypto.so.1.1
Traceback (most recent call last):
  File "/home/bladestone/.pyenv/versions/3.6.6/bin/ssserver", line 11, in <module>
    load_entry_point('shadowsocks==2.8.2', 'console_scripts', 'ssserver')()
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/server.py", line 34, in main
    config = shell.get_config(False)
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/shell.py", line 262, in get_config
    check_config(config, is_local)
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/shell.py", line 124, in check_config
    encrypt.try_cipher(config['password'], config['method'])
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/encrypt.py", line 44, in try_cipher
    Encryptor(key, method)
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/encrypt.py", line 83, in __init__
    random_string(self._method_info[1]))
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/encrypt.py", line 109, in get_cipher
    return m[2](method, key, iv, op)
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/crypto/openssl.py", line 76, in __init__
    load_openssl()
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/site-packages/shadowsocks/crypto/openssl.py", line 52, in load_openssl
    libcrypto.EVP_CIPHER_CTX_cleanup.argtypes = (c_void_p,)
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
    func = self.__getitem__(name)
  File "/home/bladestone/.pyenv/versions/3.6.6/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: undefined symbol: EVP_CIPHER_CTX_cleanup

问题修复请参照如下文章:
https://kionf.com/2016/12/15/errornote-ss/

  1. 启动过程中的错误信息
Traceback (most recent call last):
  File "/usr/bin/ssserver", line 11, in <module>
    load_entry_point('shadowsocks==2.9.0', 'console_scripts', 'ssserver')()
  File "/usr/lib/python2.7/dist-packages/shadowsocks/server.py", line 74, in main
    tcp_servers.append(tcprelay.TCPRelay(a_config, dns_resolver, False))
  File "/usr/lib/python2.7/dist-packages/shadowsocks/tcprelay.py", line 733, in __init__
    server_socket.bind(sa)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 99] Cannot assign requested address

这里的问题是使用了ssserver命令,如果需要自己搭建ss服务,需要将server ip设置为0.0.0.0. 否则,则是做为ss的客户端来使用.使用sslocal

猜你喜欢

转载自blog.csdn.net/blueheart20/article/details/81591312