Google云安装VPN服务端

DogJay 2019-01-25 系统运维 90人已围观

1

 

2。

 

3.

 

 

4.运行命令:sudo -s

切换到root用户

5.运行apt-get update :更新apt-get

g18******91@njsxit:~$ sudo -s
root@njsxit:~# apt-get update
Hit:1 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic InRelease
Get:2 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates InRelease [88.7 kB]
Get:3 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-backports InRelease [74.6 kB]
Get:4 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/universe amd64 Packages [8803 kB]               
Get:5 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/universe Translation-en [5063 kB]               
Get:6 http://security.ubuntu.com/ubuntu cosmic-security InRelease [88.7 kB]                                       
Get:7 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/multiverse amd64 Packages [158 kB]              
Get:8 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/multiverse Translation-en [113 kB]            
Get:9 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 Packages [185 kB] 
Get:10 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates/main Translation-en [77.7 kB]
Get:11 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates/universe amd64 Packages [204 kB]       
Get:12 http://archive.canonical.com/ubuntu cosmic InRelease [10.2 kB]                                            
Get:13 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates/universe Translation-en [63.7 kB]      
Get:14 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates/multiverse amd64 Packages [3080 B]
Get:15 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-updates/multiverse Translation-en [1512 B]
Get:16 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-backports/universe amd64 Packages [2888 B]
Get:17 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic-backports/universe Translation-en [1268 B]
Get:18 http://archive.canonical.com/ubuntu cosmic/partner amd64 Packages [1600 B]                            
Get:19 http://archive.canonical.com/ubuntu cosmic/partner Translation-en [708 B]
Get:20 http://security.ubuntu.com/ubuntu cosmic-security/main amd64 Packages [103 kB]
Get:21 http://security.ubuntu.com/ubuntu cosmic-security/main Translation-en [42.9 kB]
Get:22 http://security.ubuntu.com/ubuntu cosmic-security/universe amd64 Packages [47.2 kB]
Get:23 http://security.ubuntu.com/ubuntu cosmic-security/universe Translation-en [29.1 kB]
Get:24 http://security.ubuntu.com/ubuntu cosmic-security/multiverse amd64 Packages [3080 B]
Get:25 http://security.ubuntu.com/ubuntu cosmic-security/multiverse Translation-en [1512 B]
Fetched 15.2 MB in 3s (4423 kB/s)                                       
Reading package lists... Done

6.安装Python包管理工具,过程中需要输入:Y

root@njsxit:~# apt-get install python-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libnuma1
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  libpython-stdlib libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal
  python-pkg-resources python2 python2-minimal python2.7 python2.7-minimal
Suggested packages:
  python-doc python-tk python-setuptools-doc python2-doc python2.7-doc binutils binfmt-support
The following NEW packages will be installed:
  libpython-stdlib libpython2-stdlib libpython2.7-minimal libpython2.7-stdlib python python-minimal
  python-pkg-resources python-setuptools python2 python2-minimal python2.7 python2.7-minimal
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 4330 kB of archives.
After this operation, 18.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 libpython2.7-minimal amd64 2.7.15-4ubu
ntu4 [335 kB]
Get:2 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python2.7-minimal amd64 2.7.15-4ubuntu
4 [1308 kB]
Get:3 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python2-minimal amd64 2.7.15-3 [28.1 k
B]
Get:4 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python-minimal amd64 2.7.15-3 [5996 B]
Get:5 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 libpython2.7-stdlib amd64 2.7.15-4ubun
tu4 [1907 kB]
Get:6 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python2.7 amd64 2.7.15-4ubuntu4 [239 k
B]
Get:7 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 libpython2-stdlib amd64 2.7.15-3 [7728
 B]
Get:8 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 libpython-stdlib amd64 2.7.15-3 [5824 
B]
Get:9 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python2 amd64 2.7.15-3 [26.5 kB]
Get:10 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python amd64 2.7.15-3 [7828 B]
Get:11 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python-pkg-resources all 40.2.0-1 [12
8 kB]
Get:12 http://asia-northeast1.gce.archive.ubuntu.com/ubuntu cosmic/main amd64 python-setuptools all 40.2.0-1 [331 k
B]
Fetched 4330 kB in 1s (3682 kB/s)       
Selecting previously unselected package libpython2.7-minimal:amd64.
(Reading database ... 59492 files and directories currently installed.)
Preparing to unpack .../0-libpython2.7-minimal_2.7.15-4ubuntu4_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.15-4ubuntu4) ...
Selecting previously unselected package python2.7-minimal.
Preparing to unpack .../1-python2.7-minimal_2.7.15-4ubuntu4_amd64.deb ...
Unpacking python2.7-minimal (2.7.15-4ubuntu4) ...
Selecting previously unselected package python2-minimal.
Preparing to unpack .../2-python2-minimal_2.7.15-3_amd64.deb ...

 

root@njsxit:~# apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libnuma1
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-8 dpkg-dev fakeroot g++ g++-8 gcc
  gcc-8 javascript-common libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5
  libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libexpat1-dev libfakeroot
  libfile-fcntllock-perl libgcc-8-dev libgomp1 libisl19 libitm1 libjs-jquery libjs-sphinxdoc libjs-underscore
  liblsan0 libmpc3 libmpx2 libpython-all-dev libpython-dev libpython2-dev libpython2.7 libpython2.7-dev
  libquadmath0 libstdc++-8-dev libtsan0 libubsan1 linux-libc-dev make manpages-dev python-all python-all-dev
  python-asn1crypto python-cffi-backend python-configparser python-crypto python-cryptography python-dbus
  python-dev python-entrypoints python-enum34 python-gi python-idna python-ipaddress python-keyring
  python-keyrings.alt python-pip-whl python-secretstorage python-six python-wheel python-xdg python2-dev
  python2.7-dev
Suggested packages:
  binutils-doc cpp-doc gcc-8-locales debian-keyring g++-multilib g++-8-multilib gcc-8-doc libstdc++6-8-dbg
  gcc-multilib autoconf automake libtool flex bison gdb gcc-doc gcc-8-multilib libgcc1-dbg libgomp1-dbg
  libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg
  apache2 | lighttpd | httpd glibc-doc bzr libstdc++-8-doc make-doc python-crypto-doc python-cryptography-doc
  python-cryptography-vectors python-dbus-dbg python-dbus-doc python-enum34-doc python-gi-cairo gnome-keyring
  libkf5wallet-bin gir1.2-gnomekeyring-1.0 python-fs python-gdata python-keyczar python-secretstorage-doc
The following NEW packages will be installed:
  binutils binutils-common binutils-x86-64-linux-gnu build-essential cpp cpp-8 dpkg-dev fakeroot g++ g++-8 gcc
  gcc-8 javascript-common libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libasan5
  libatomic1 libbinutils libc-dev-bin libc6-dev libcc1-0 libdpkg-perl libexpat1-dev libfakeroot
  libfile-fcntllock-perl libgcc-8-dev libgomp1 libisl19 libitm1 libjs-jquery libjs-sphinxdoc libjs-underscore
  liblsan0 libmpc3 libmpx2 libpython-all-dev libpython-dev libpython2-dev libpython2.7 libpython2.7-dev
  libquadmath0 libstdc++-8-dev libtsan0 libubsan1 linux-libc-dev make manpages-dev python-all python-all-dev
  python-asn1crypto python-cffi-backend python-configparser python-crypto python-cryptography python-dbus
  python-dev python-entrypoints python-enum34 python-gi python-idna python-ipaddress python-keyring
  python-keyrings.alt python-pip python-pip-whl python-secretstorage python-six python-wheel python-xdg
  python2-dev python2.7-dev
0 upgraded, 72 newly installed, 0 to remove and 0 not upgraded.
Need to get 74.9 MB of archives.
After this operation, 238 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

输入Y

Setting up python-six (1.11.0-2) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...
Setting up libfakeroot:amd64 (1.22-2ubuntu1) ...
Setting up python-enum34 (1.1.6-2) ...
Setting up libpython2.7:amd64 (2.7.15-4ubuntu4) ...
Setting up libalgorithm-diff-perl (1.19.03-2) ...
Processing triggers for man-db (2.8.4-2) ...
Setting up libmpc3:amd64 (1.1.0-1) ...
Setting up libc-dev-bin (2.28-0ubuntu1) ...
Setting up javascript-common (11) ...
Setting up python-dbus (1.2.8-2build1) ...
Setting up python-ipaddress (1.0.17-1) ...
Setting up manpages-dev (4.16-1) ...
Setting up python-pip (9.0.1-2.3) ...
Setting up libc6-dev:amd64 (2.28-0ubuntu1) ...
Setting up libasan5:amd64 (8.2.0-7ubuntu1) ...
Setting up python-all (2.7.15-3) ...
Setting up python-entrypoints (0.2.3-3) ...
Setting up libitm1:amd64 (8.2.0-7ubuntu1) ...
Setting up python-xdg (0.25-4ubuntu1) ...
Setting up libubsan1:amd64 (8.2.0-7ubuntu1) ...
Setting up libisl19:amd64 (0.20-2) ...
Setting up cpp-8 (8.2.0-7ubuntu1) ...
Setting up cpp (4:8.2.0-1ubuntu1) ...
Setting up libbinutils:amd64 (2.31.1-6ubuntu1) ...
Setting up fakeroot (1.22-2ubuntu1) ...
update-alternatives: using /usr/bin/fakeroot-sysv to provide /usr/bin/fakeroot (fakeroot) in auto mode
Setting up python-keyrings.alt (3.1-1) ...
Setting up libalgorithm-merge-perl (0.08-3) ...
Setting up libalgorithm-diff-xs-perl (0.04-5) ...
Setting up python-cryptography (2.3-1ubuntu1) ...
Setting up libexpat1-dev:amd64 (2.2.6-1) ...
Setting up libgcc-8-dev:amd64 (8.2.0-7ubuntu1) ...
Setting up libpython2.7-dev:amd64 (2.7.15-4ubuntu4) ...
Setting up python2.7-dev (2.7.15-4ubuntu4) ...
Setting up binutils-x86-64-linux-gnu (2.31.1-6ubuntu1) ...
Setting up python-secretstorage (2.3.1-2) ...
Setting up libstdc++-8-dev:amd64 (8.2.0-7ubuntu1) ...
Setting up python-keyring (15.1.0-1) ...
Setting up libpython2-dev:amd64 (2.7.15-3) ...
Setting up python2-dev (2.7.15-3) ...
Setting up binutils (2.31.1-6ubuntu1) ...
Setting up libpython-dev:amd64 (2.7.15-3) ...
Setting up python-dev (2.7.15-3) ...
Setting up libpython-all-dev:amd64 (2.7.15-3) ...
Setting up gcc-8 (8.2.0-7ubuntu1) ...
Setting up g++-8 (8.2.0-7ubuntu1) ...
Setting up dpkg-dev (1.19.0.5ubuntu5) ...
Setting up python-all-dev (2.7.15-3) ...
Setting up gcc (4:8.2.0-1ubuntu1) ...
Setting up g++ (4:8.2.0-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.5ubuntu2) ...
Processing triggers for libc-bin (2.28-0ubuntu1) ...

安装完成

6.安装Shadowsocks

root@njsxit:~# pip install shadowsocks
The directory '/home/g18251986891/.cache/pip/http' or its parent directory is not owned by the current user and the
 cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you
 may want sudo's -H flag.
The directory '/home/g18251986891/.cache/pip' or its parent directory is not owned by the current user and caching 
wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may wa
nt sudo's -H flag.
Collecting shadowsocks
  Downloading https://files.pythonhosted.org/packages/02/1e/e3a5135255d06813aca6631da31768d44f63692480af3a162181800
8eb4a/shadowsocks-2.8.2.tar.gz
Installing collected packages: shadowsocks
  Running setup.py install for shadowsocks ... done
Successfully installed shadowsocks-2.8.2
root@njsxit:~# mkdir /etc/shadowsocks
root@njsxit:~# vim /etc/shadowsocks/ss.json
root@njsxit:~# ssserver -c /etc/sh
shadow       shadow-      shadowsocks/ shells       
root@njsxit:~# ssserver -c /etc/sh
shadow       shadow-      shadowsocks/ shells       
root@njsxit:~# ssserver -c /etc/shadowsocks/ss.json -d start
INFO: loading config from /etc/shadowsocks/ss.json
2019-01-25 15:31:48 WARNING  warning: your timeout 3000 seems too long
2019-01-25 15:31:48 INFO     loading libcrypto from libcrypto.so.1.1
Traceback (most recent call last):
  File "/usr/local/bin/ssserver", line 11, in <module>
    load_entry_point('shadowsocks==2.8.2', 'console_scripts', 'ssserver')()
  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()
  File "/usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py", line 52, in load_openssl
    libcrypto.EVP_CIPHER_CTX_cleanup.argtypes = (c_void_p,)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 384, 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

报错啦

 

修复:

root@njsxit:~# vim /usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py
root@njsxit:~# ssserver -c /etc/shadowsocks/ss.json -d start
INFO: loading config from /etc/shadowsocks/ss.json
2019-01-25 15:39:22 WARNING  warning: your timeout 3000 seems too long
2019-01-25 15:39:22 INFO     loading libcrypto from libcrypto.so.1.1
started
root@njsxit:~# 

启动OK

吐槽(0)

上一篇:Git相关使用

下一篇:Hadoop单机安装

文章评论

    共有0条评论

    验证码:

文章目录