Due to work reasons, I often use Google search. Initially, I bought a VPN or used Lantern, but later I found that sometimes the download speed was very slow. Then I thought that as a technical person, I should do it myself.
Two years ago, I started building ss with Bandwagonhost. It cost $19.9 per year. I remember it was quite troublesome to operate at that time, so I asked for help from others. Then last year, when I renewed it, I felt that the one I built myself was pretty good. I use it myself, watch videos less frequently, and don't visit illegal websites, so the speed is acceptable.
This year, I received an email saying that I couldn't renew it anymore... because I bought openVZ at that time, and it doesn't support renewal. I have been depressed for a long time. But I still need to use it. During the Black Friday period, I bought another one for $29.9 per year, intending to watch videos. After buying it, I found that it was very simple to set up, and it only took less than ten minutes to complete. Thinking about the shadow of the last setup, it was enough.
As for why I suddenly wanted to write an article about this, firstly, there are always people asking me to borrow their accounts. If I don't let them use it, I feel sorry for them. If I let them use it, I'm afraid they will visit some websites that will get my account blocked. Secondly, I want to save my own operation process so that when I can't find it online, I still have a backup.
The following content is reprinted, but I have tried it myself, and my new SS was built according to the steps.
Reprint#
Daily Automatic Restart of Bandwagonhost
Step 1: Purchase VPS on Bandwagonhost Platform#
Open the Bandwagonhost website, Address 1, Address 2, Address 3, as shown below:
Choose a price you can accept and click "Order"
Then choose the payment method, select the data center, and add to cart
Next is the order details. Remember to search for Bandwagonhost discount codes on Baidu, enter the code, and click "Validate Code" to see the price reduction. Then click "CheckOut" to complete the payment.
On the order page, enter the registration information. Fill in the information truthfully. If you are in China, fill in China! Otherwise, it may be considered as a fraudulent purchase and fail.
Choose Alipay as the payment method and click "Complete Order" to finish the order.
Confirm the information is correct and click "Pay now" to make the payment.
After successful payment, you will receive an email notification. The SSH IP, password, and port number will be sent to your email. You can use SSH tools like Xshell to log in to the VPS system for operation. (If you don't receive it, please check your spam folder)
VPS purchase completed!
Step 2: Set up SS#
Mac
Open Terminal and enter the following code to log in to the VPS. Replace "root" with your username, and change the IP and port number to the IP and port of your VPS. Press Enter.
ssh -p port_number root@ip
Enter "yes" to confirm, paste the password, and press Enter. Please note that the password will not be displayed when you enter it. Just copy and paste it, and press Enter. When "root@vultr:~#" appears, it means the connection is successful.
After the Bandwagonhost installation is completed, the default system is Centos 6 x86 bbr, which comes with Google BBR acceleration optimization, so there is no need to install it separately. We can directly start installing SS.
Install the wget command tool:
yum install wget
Run the following three commands one by one, as shown in the figure below, and select the options as prompted. Suggestion: choose a port number greater than 1000.
wget — no-check-certificate -O shadowsocks.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
chmod +x shadowsocks.sh
./shadowsocks.sh 2>&1 | tee shadowsocks.log
After the installation is completed, record the highlighted connection information, and then you can close Terminal.
Single-user server setup completed! (^▽^)
Multi-user Configuration for SS (Optional)#
If you are using it by yourself, it is not recommended to configure multiple users. You can skip this step, as a single user can be shared by two people. If you are not familiar with the operation, it is easy to make mistakes in this step and waste effort!!!
If you decide to configure it, continue with this step. First, pay attention to the following:
- Switch to English input method.
- Double-check before saving, not even a comma should be added.
- If not mentioned, keep the default settings unless you are sure about it.
- Restart shadowsocks after configuration to make it effective.
First, prepare the configuration information and copy the following code to Notepad (lines starting with "#" are comments and should not be copied).
# 1. Edit the port and corresponding password.
# 2. Add or delete users in "port_password"{……}.
# 3. User information format, pay attention to the comma at the end: "port": "password", such as "8006": "123456",
# 4. "method" is the encryption method, you can modify it, but the default is fine.
{
"server":"0.0.0.0",
"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-gcm",
"fast_open": false
}
Then, create the shadowsocks.json configuration file in the /etc directory:
vi /etc/shadowsocks.json
Entering vim will show a column of tildes. Pay attention to the following important steps:
After entering vim, press "a" to delete the original configuration information, then paste the prepared "configuration information" to replace the original content, and check for any errors.
Press Esc, enter "" to save and exit.
For example, the configuration in the "port_password"{……} sets up 3 users, each using port 8000, 8001, and 8002 respectively, with the password after the colon. Pay attention that there is no comma at the end of the last one.
Restart shadowsocks to make it effective:
/etc/init.d/shadowsocks restart
Turn off the firewall:
service iptables stop
chkconfig iptables off
Multi-user configuration completed!
Step 3: Set up scheduled restart#
- Set the time zone to China, pay attention to the space in the middle.
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
-
It will ask if you want to write the settings, just press Enter.
-
Set it to start automatically when the system boots:
chkconfig crond on
- Start the service:
service crond start
- Edit:
crontab –e
- Press "i" to enter:
30 3 * * * root /sbin/reboot
(This means automatic restart at 3:30 AM) Press Esc, then press Shift+zz.
- Restart:
service crond restart