root@hot-cluster:~# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:JO3v66ip8fefzexPuZR2/7uoDXtfqy1DIzNMrRleJYc root@hot-cluster-1.localdomain The key's randomart image is: +---[RSA 2048]----+ | . | | . E o | | . o . + | | + o o | | S + = | | . O o o| | . ..= .=+| | o ..o +O=.*| | ..+o.o====XOB| +----[SHA256]-----+ root@hot-cluster:~# ls -la total 32 drwx------ 5 root root 4096 Aug 20 06:17 . drwxr-xr-x 23 root root 4096 Aug 20 05:26 .. -rw-r--r-- 1 root root 3106 Oct 22 2015 .bashrc drwx------ 2 root root 4096 Mar 14 2017 .cache drwxr-xr-x 2 root root 4096 Mar 14 2017 .nano -rw-r--r-- 1 root root 148 Aug 17 2015 .profile drwx------ 2 root root 4096 Aug 20 06:17 .ssh -rw-r--r-- 1 root root 197 Aug 20 05:27 virt-sysprep-firstboot.log root@hot-cluster:~#
sudo apt update sudo apt install nginx sudo ufw allow 'Nginx HTTP' # 检查下 nginx 的状态 sudo systemctl status nginx # output ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2019-08-20 06:35:40 EDT; 15h ago Process: 1983 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid (code=exited, status=1/FAILURE) Process: 1900 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 1996 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Main PID: 1902 (nginx) Tasks: 3 Memory: 2.2M CPU: 4.669s CGroup: /system.slice/nginx.service ├─19902 nginx: master process /usr/sbin/nginx -g daemon on; master_process on ├─19903 nginx: worker process └─19904 nginx: worker process
Aug 20 06:35:40 hot-cluster.localdomain systemd[1]: Starting A high performance web server and a reverse proxy server... Aug 20 06:35:40 hot-cluster.localdomain systemd[1]: Started A high performance web server and a reverse proxy server.
root@hot-cluster:/etc/nginx/conf.d# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
root@hot-cluster:~# python3 dropbox.py help Dropbox command-line interface
commands:
Note: use dropbox help <command> to view usage for a specific command.
autostart automatically start Dropbox at login exclude ignores/excludes a directory from syncing filestatus get current sync status of one or more files help provide help lansync enables or disables LAN sync ls list directory contents with current sync status proxy set proxy settings for Dropbox puburl get public url of a file in your Dropbox's public folder running return whether Dropbox is running sharelink get a shared link for a file in your Dropbox start start dropboxd status get current status of the dropboxd stop stop dropboxd throttle set bandwidth limits for Dropbox update download latest version of Dropbox version print version information for Dropbox
root@hot-cluster-1:~# apt install python3-pip Reading package lists... Done Building dependency tree Reading state information... Done # ...... After this operation, 201 MB of additional disk space will be used. Do you want to continue? [Y/n] Y # 输入 Y # ...... Setting up python3-pip (8.1.1-2ubuntu0.4) ... Setting up python3-setuptools (20.7.0-1) ... Setting up python3-wheel (0.29.0-1) ... Processing triggers for libc-bin (2.23-0ubuntu11) ... root@hot-cluster-1:~# pip3 -V pip 8.1.1 from /usr/lib/python3/dist-packages (python 3.5) root@hot-cluster-1:~#
root@hot-cluster-1:~# pip3 install https://github.com/shadowsocks/shadowsocks/archive/master.zip Traceback (most recent call last): File "/usr/bin/pip3", line 11, in <module> sys.exit(main()) File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python3.5/locale.py", line 594, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting
来了个小惊喜,解决方法:
1
root@hot-cluster-1:~# export LC_ALL=C
再次安装:
1 2 3 4 5 6 7 8 9 10
root@hot-cluster-1:~# pip3 install https://github.com/shadowsocks/shadowsocks/archive/master.zip Collecting https://github.com/shadowsocks/shadowsocks/archive/master.zip Downloading https://github.com/shadowsocks/shadowsocks/archive/master.zip (115kB) 100% |################################| 122kB 342kB/s Installing collected packages: shadowsocks Running setup.py install for shadowsocks ... done Successfully installed shadowsocks-3.0.0 You are using pip version 8.1.1, however version 19.2.2 is available. You should consider upgrading via the 'pip install --upgrade pip'command. root@hot-cluster-1:~#
root@hot-cluster-1:~# ssserver -c /etc/shadowsocks/config.json INFO: loading config from /etc/shadowsocks/config.json 2019-08-21 03:15:24 INFO loading libcrypto from libcrypto.so.1.0.0 2019-08-21 03:15:24 INFO starting server at :::8388
配置 Systemd 来管理 shadowsocks
测试通过后,我们将shadowsocks 做为一个服务来启动,这样的话比较方便。
创建 service 文件
1
root@hot-cluster-1:~# vim /etc/systemd/system/shadowsocks-server.service
编写服务内容: shadowsocks-server.service
1 2 3 4 5 6 7 8 9 10
[Unit] Description=Shadowsocks Server After=network.target
root@hot-cluster-1:~# systemctl enable shadowsocks-server.service Created symlink from /etc/systemd/system/multi-user.target.wants/shadowsocks-server.service to /etc/systemd/system/shadowsocks-server.service. root@hot-cluster-1:~#
## Run `sudo apt-get install -y nodejs` to install Node.js 10.x and npm ## You may also need development tools to build native addons: sudo apt-get install gcc g++ make ## To install the Yarn package manager, run: curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo"deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list sudo apt-get update && sudo apt-get install yarn
root@hot-cluster-1:~# apt install nodejs -y Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: nodejs 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 15.8 MB of archives. After this operation, 76.5 MB of additional disk space will be used. Get:1 https://deb.nodesource.com/node_10.x xenial/main amd64 nodejs amd64 10.16.3-1nodesource1 [15.8 MB] Fetched 15.8 MB in 3s (4951 kB/s) Selecting previously unselected package nodejs. (Reading database ... 99725 files and directories currently installed.) Preparing to unpack .../nodejs_10.16.3-1nodesource1_amd64.deb ... Unpacking nodejs (10.16.3-1nodesource1) ... Processing triggers for man-db (2.7.5-1) ... Setting up nodejs (10.16.3-1nodesource1) ...