Due to work reasons, I often use Google search. At first, I bought a VPN or used Lantern, but later I found that sometimes the download speed was very slow. Then I thought, as a technical person, I should do it myself.
Two years ago, I started building ss with Bandwagonhost. It cost $19.9 per year, and 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... 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 was done in less than ten minutes. Thinking about the shadow of the last setup, it was enough.
As for why I suddenly wanted to write an article about this, first, 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. Second, 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 all reprinted, but I have tried it myself, and my new SS is built according to the steps.
Reprint#
Daily Automatic Restart of Bandwagonhost
Step 1, Purchase VPS from Bandwagonhost#
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
Then there is the order details. Remember to search for Bandwagonhost discount codes on Baidu, enter the code, and click "Validate Code" to see the price decrease. Then click "CheckOut" to make the payment.
Order page, enter registration information. Fill in truthfully, if you are from China, fill in China! Otherwise, it may be considered as a fraudulent purchase and fail.
Choose Alipay as the payment method, "Complete Order" to finish the order.
Confirm the information is correct, 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 our email. You can use SSH tools like Xshell to log in to the VPS system for operation. (If you haven't received 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 to the IP and port of your VPS, then 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, then press Enter. If you see "root@vultr:~#", it means the connection is successful.
After the Bandwagonhost installation, 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 in order, as shown in the figure below, and select 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 complete, 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, so you can skip this step. Even with a single user, two people can share it. 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
- Check carefully before saving, there should not be any extra commas
- If not mentioned, keep the default settings unless you are sure, do not make unnecessary changes
- Restart shadowsocks after configuration to take effect
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 ports and corresponding passwords
# 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
When you see a column of tildes, you have entered vim. Pay attention, this operation is important:
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 below sets up 3 users, each using a different port (8000, 8001, 8002) with a password. Pay attention to the absence of a comma at the end of the last one.
Restart shadowsocks to take effect:
/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 on boot
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