Configuration of shadowsocks in Ubuntu

Source: Internet
Author: User
System Environment: Ubuntu14.04LTS runs the following command to install different Linux distributions: Debian/Ubuntu: apt-getinstallpython-pippipinstallshadowsocksCentOS: yuminstallpython-setuptools & amp; easy_installpippipinstallshad

System Environment: Ubuntu 14.04 LTS

Install

The commands executed by different Linux distributions are as follows:

Debian/Ubuntu:
Apt-get install python-pip
Pip install shadowsocks
 
CentOS:
Yum install python-setuptools & easy_install pip
Pip install shadowsocks

Configuration

Sudo vim/etc/shadowsocks. json
// The json file is created by yourself, not the built-in file.

The configuration file is roughly as follows:

{
"Server": "server ip Address ",
"Server_port": 19175,
"Local_address": "127.0.0.1 ",
"Local_port": 1080,
"Password": "password ",
"Timeout": 300,
"Method": "aes-256-cfb ",
"Fast_open": false
}

Start the ss Client

The first two steps are very simple, but some people are wondering how to use them after installation. In fact, you can use sslocal-help to view the help information.

Sslocal-c/etc/shadowsocks. json

A command proxy can be started.

Ubuntu runs automatically after it is started

Now you can access the Internet scientifically, but you have to manually open the terminal to enter a command every time you start the system. Although this command is not long, you have to manually enter it every time, and it seems quite low, and the terminal proxy is disabled.

Write a script

We can create a new file named shadow. sh under/home, for example, write the command we need to start the ss client, and then save it.

#! /Bin/bash
# Shadow. sh
Sslocal-c/etc/shadowsocks. json

Check whether the command sh/home/shadow. sh can be executed on the terminal. If the command is successful, information will be output. You can also try it in the browser. At this time, even if you enter less, but the terminal is closed, we can let him run in the background, nohup sh/home/shadow. sh &.

Add to start running

Here, we need to edit a file named rc and local under/etc. We need root permission. su gets root permission first on the terminal. If you have a root account, then vim/etc/rc. local Editing: Enter nohup bash/home/shadow before exit. sh>/home/d.txt & Save.

Now you can rebootand restart the server. The test shows that the server cannot be automatically run on the backend server. You can check whether the d.txt output is/home/shadow. sh line 3: sslocal: command not found, and the browser cannot be connected to the proxy server.

After some searches, we found that the sslocal command was not found far away from linux? You need to add the path. We found that the sslocal and ssserver commands exist under/usr/local/bin. In fact, you do not need to add them to the profile, you can directly move these two files to/bin.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-09/123579.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.