Shadowsocks 一键安装

文章
林里克斯

Linux下使用sh脚本一键安装Shadowsocks


一:实验平台:CentOs 6.8
二:此次实验用Python版Shadowsocks



Shadowsocks是一个基于python的轻量级socks代理软件,可以在任何系统简单的实现访问被屏蔽的网站。
关于本脚本
1、一键安装 Shadowsocks-Python, ShadowsocksR, Shadowsocks-Go, Shadowsocks-libev 版(四选一)服务端;
2、各版本的启动脚本及配置文件名不再重合;
3、每次运行可安装一种版本;
4、支持以多次运行来安装多个版本,且各个版本可以共存(注意端口号需设成不同);
5、若已安装多个版本,则卸载时也需多次运行(每次卸载一种);
6、Shadowsocks-Python 和 ShadowsocksR 安装后不可同时启动(因为本质上都属 Python 版)。


一、安装Shadowsocks


1.四合一下载安装脚本

$ wget --no-check-certificate -O shadowsocks-all.sh https://raw.githubusercontent.com/JarboU/shadowsocks/master/shadowsocks-all.sh

2.此次试验用Python版,下载链接

$ wget --no-check-certificate -O shadowsocks.sh https://raw.githubusercontent.com/JarboU/shadowsocks/master/shadowsocks.sh

设置权限

$ ll -l

total 16
-rw-r--r-- 1 root root 13719 Dec 27 01:07 shadowsocks.sh
chmod u+x shadowsocks.sh

3.执行脚本

$ ./shadowsocks.sh 2>&1 | tee shadowsocks.log

二、开始配置


1.脚本执行后提示如下:

"#############################################################"
"# One click Install Shadowsocks server                      #"
"# Intro: https://www.kjarbo.com/archives/148                #"
"# Author: JarboU <mylinux@kjarbo.com>                       #"
"# Github: https://github.com/JarboU/shadowsocks             #"
"#############################################################"

Please enter password for shadowsocks-python
(Default password: redhat):******      #要求你配置密码后续登录用的密码

---------------------------
password = ******       #会显示你上面输入的密码
---------------------------

Please enter a port for shadowsocks-python [1-65535]
(Default port: 8989):8888           #配置端口

---------------------------
port = 8888
---------------------------

Please select stream cipher for shadowsocks-python:
1) aes-256-gcm
2) aes-192-gcm
3) aes-128-gcm
4) aes-256-ctr
5) aes-192-ctr
6) aes-128-ctr
7) aes-256-cfb
8) aes-192-cfb
9) aes-128-cfb
10) camellia-128-cfb
11) camellia-192-cfb
12) camellia-256-cfb
13) chacha20-ietf-poly1305
14) chacha20-ietf
15) chacha20
16) rc4-md5
Which cipher you'd select(Default: aes-256-gcm):7   #要你选择加密方式

---------------------------
cipher = aes-256-cfb
---------------------------


Press any key to start...or Press Ctrl+C to cancel  #输入任意键开始安装

2.安装完成

Congratulations, Shadowsocks-python server install completed!
Your Server IP        :  *.*.*.*    #你的服务器IP
Your Server Port      :  8888 
Your Password         :  ****** 
Your Encryption Method:  aes-256-cfb 

Welcome to visit:https://www.kjarbo.com/archives/148
Enjoy it!

三、其他配置


1.卸载shadowsocks

$ ./shadowsocks.sh uninstall

2.配置文件

/etc/shadowsocks.json

3.单用户配置

{
    "server":"your_server_ip",
    "server_port":8989,
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"yourpassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

4.多用户配置

{
    "server":"your_server_ip",
    "local_address": "127.0.0.1",
    "local_port":1080,
    "port_password":{
         "8989":"password0",
         "9001":"password1",
         "9002":"password2",
         "9003":"password3",
         "9004":"password4"
    },
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

5.操作命令

/etc/init.d/shadowsocks-python start | stop | restart | status
分别是启动|停止|重启|状态

四、其他版本下载


1.Go版Shadowsocks下载

$ wget --no-check-certificate -O shadowsocks-go.sh https://raw.githubusercontent.com/JarboU/shadowsocks/master/shadowsocks-go.sh
#操作与Python版一样

2.libev版的Shadowsocks下载

$ wget --no-check-certificate -O shadowsocks-libev.sh https://raw.githubusercontent.com/JarboU/shadowsocks/master/shadowsocks-libev.sh
#操作与Python版一样

3.ShadowsocksR下载

$ wget --no-check-certificate -O shadowsocksR.sh https://raw.githubusercontent.com/JarboU/shadowsocks/master/shadowsocksR.sh
chmod +x shadowsocksR.sh
#操作与Python版一样
https://github.com/shadowsocks/shadowsocks-qt5
#GitHub

注意:以上单版本不可与该四合一版本混用


五、Windows客服端下载


1.Shadowsocks

https://github.com/shadowsocks/shadowsocks-windows/releases

2.ShadowsocksR

https://github.com/shadowsocksr-backup/shadowsocksr-csharp/releases

Thinks: 秋水逸冰


Over ~

版权协议须知!

本篇文章来源于 Uambiguous ,如本文章侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意

1059 0 2017-02-03


分享:
icon_mrgreen.gificon_neutral.gificon_twisted.gificon_arrow.gificon_eek.gificon_smile.gificon_confused.gificon_cool.gificon_evil.gificon_biggrin.gificon_idea.gificon_redface.gificon_razz.gificon_rolleyes.gificon_wink.gificon_cry.gificon_surprised.gificon_lol.gificon_mad.gificon_sad.gificon_exclaim.gificon_question.gif
博主卡片
林里克斯 博主大人
一个致力于Linux的运维平台
运维时间
搭建这个平台,只为分享及记载自己所遇之事和难题。

现在时间 2024-04-30

今日天气
站点统计
  • 文章总数:240篇
  • 分类总数:29个
  • 评论总数:10条
  • 本站总访问量 217178 次

@奥奥

@Wong arrhenius 牛比

@MakerFace 厉害了!