/System Requirements
CentOS 6+ / Debian 6+ / Ubuntu 14.04 +
Debian 7 x64 is recommended. This is the system I have always used, and my script has the lowest error rate on it. It is also the easiest system for installing Ruisu (Ruisu does not support OpenVZ).
For CentOS, support for CentOS 6 and 7 was added based on everyone’s requests. CentOS 7
has its own firewall issue (firewalld), which you will need to resolve yourself. Other versions have not been tested.
Script Version
Ver: 2.0.23
Script Features:
At present, most ShadowsocksR scripts available online only provide basic functions such as install/uninstall,
which are still not simple or convenient enough for beginners. If you want to modify account settings, you still have to edit files manually, so those ShadowsocksR scripts can only really be called one-click installation scripts. Since there was no ShadowsocksR one-click management script that satisfied me, I made one myself. I specifically learned Shell and then wrote this ShadowsocksR one-click management script!
- Supports limiting port speed
- Supports limiting the number of devices per port
- Supports displaying currently connected IPs
- Supports displaying SS/SSR connection info + QR code
- Supports switching between single-port and multi-port management
- Supports one-click installation of BBR
- Supports one-click installation of Ruisu
- Supports one-click installation of LotServer
- Supports one-click blocking of spam (SMAP)/BT/PT
Installation Steps
Simply put, if you do not understand any of this, just keep pressing Enter all the way through!
This script requires Linux root account privileges to install and run properly, so if you are not using the root account, please switch to root first. If you are already using
the root account, then skip this step!
- sudo su
- For many CentOS systems without wget and git installed, enter:
- yum install wget git -y
- Install wget and git on debian and ubutntu
- apt-get instalwget git -y
Note: The above is for setting up the basic environment. Once that is done, you can install the script below.
After entering the above command and pressing Enter, you will be prompted to enter the current user’s password. Enter it and press Enter. If no error is reported, continue with the steps below to install ShadowsocksR.
For scripts
after version v2.0.0, please uninstall the old ShadowsocksR server script first, and then reinstall it!
-
wget –N —no–check–certificate
http://i.wuw.red/ssr.sh && chmod +x ssr.sh
&& bash ssr.sh
Because sometimes the shell script may fail to execute due to webpage formatting issues, please use manual mode instead—that is, split the command apart and copy and run it step by step.
wget –N —no–check–certificate
http://i.wuw.red/ssr.sh This means downloading the script
chmod +x ssr.sh Grant execute permission to the script
bash ssr.sh This means running the script
The script will compile automatically. If you don't know what to enter, just keep pressing Enter.
Alternative download link (if the link above doesn’t work, use this one):
-
wget –N —no–check–certificate
https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ssr.sh
&& chmod +x ssr.sh && bash
ssr.sh
This is the backup one~~
After downloading and running it, you will be prompted to enter a number to choose what you want to do.
Enter 1
to start installing the ShadowsocksR server, and you will be prompted to enter Shadowsocks
port/password/encryption method/
protocol/obfuscation (protocol and obfuscation are selected by entering numbers) and other parameters.
Instructions
Run the script,
- bash ssr.sh
Usually, run this bash command; at the place where you just logged in as ROOT, enter ./ssr.sh
Enter the corresponding number to execute the corresponding command.
- Please enter a number to select a menu option
-
1.
Install
ShadowsocksR -
2.
Update
ShadowsocksR -
3.
Uninstall
ShadowsocksR - 4. Install libsodium(chacha20)
- ————————————
-
5.
View
account information -
6.
Show
connection information -
7.
Set
user configuration -
8.
Manually
modify configuration -
9.
Switch
port mode - ————————————
-
10.
Start
ShadowsocksR -
11.
Stop
ShadowsocksR -
12.
Restart
ShadowsocksR -
13.
View
ShadowsocksR
logs - ————————————
-
14.
Other functions -
15.
Upgrade script -
Current status:
Installed
and
started -
Current mode:
Single port - Please enter a number (1–15):
The basic commands are shown above; enter ./ssr.sh to display them.
When you are in single-port mode, using
7. Set user configuration will modify
the single-port account configuration.When you are in multi-port mode, using
7. Set user configuration will add/delete/modify
the multi-port account configuration.
File locations
Installation directory:/usr/local/shadowsocksr
Configuration file:/etc/shadowsocksr/user-config.json
Other notes
After ShadowsocksR is installed, it is automatically set up as
a system service, so it supports operations such as starting/stopping via the service command, and also supports starting on boot.
- Start ShadowsocksR:service ssr start
- Stop ShadowsocksR:service ssr stop
- Restart ShadowsocksR:service ssr restart
-
Check ShadowsocksR status:service ssr
status
ShadowsocksR supports UDP forwarding by default, and no server-side configuration is required.
This script already integrates installation/uninstallation of
ServerSpeeder cracked version, but please check whether it is supported
(ServerSpeeder does not support OpenVZ)
Download address for old versions before v2.0.0:
Currently supported protocols and obfuscation:
Protocol: origin,auth_sha1_v4,auth_aes128_md5,auth_aes128_sha1,auth_chain_a
Obfs: plain,http_simple,http_post,random_head,tls1.2_ticket_auth,tls1.2_ticket_fastauth(requires a server version released after 06/04)
origin and plain are the original versions; the bolded ones are recommended.
If you want to use the tls1.2_ticket_fastauth
obfuscation plugin, then simply select tls1.2_ticket_auth on the server side and tls1.2_ticket_fastauth
on the client side.If the server-side obfuscation parameter is set to: tls1.2_ticket_auth_compatible (compatible with the original version)
Then the client can use the following obfuscation methods: plain / tls1.2_ticket_auth /
tls1.2_ticket_fastauthThe difference between tls1.2_ticket_auth and
tls1.2_ticket_fastauth
is that the latter does not wait for a server response, so it does not increase latency. It is suitable when, due to the latency added by the obfuscation plugin, you would otherwise have to choose the original obfuscation
plain, but because of factors such as QOS you are weighing latency against interference/rate limiting and similar issues; in that case, you can choose the tls1.2_ticket_fastauth
client obfuscation plugin!
Please note if you are using Alibaba Cloud/Tencent Cloud or other services with external firewalls such as security groups or rule groups
The Difference Between Single-Thread Speed Limiting and Total Port Speed Limiting in ShadowsocksR Port Rate Limiting
Note: To use this feature in the script, you need to re-download the script and reinstall the ShadowsocksR server version released after February 15.
ShadowsocksR failed to start, and the log shows the error: Exception: libsodium not
found
This means you are using a chacha20
series encryption method, but the libsodium support library is not installed, causing ShadowsocksR to fail to start. Run the script and choose option
4
to install the libsodium support library. If the installation fails, please choose another encryption method; the impact on speed is minimal.
Errors such as wget: unknown host “softs.fun”
This means my domain name cannot be resolved, most likely due to a DNS issue. Please change your DNS to Google DNS.
Error: wget: command not found
This means your system has been stripped down too much and wget is not installed, so you need to install wget.
Upgrade Script
To upgrade the script, you only need to download the script file again. It will automatically overwrite the original file.
Scheduled Restart
Some people may need to restart the ShadowsocksR server on a schedule to ensure stability and so on, so crontab is used here for scheduling.
This script is only my first practice project while learning Shell scripting, so there are quite a few issues with its logic and structure. If you run into any bugs, please actively report them!