|
There are always times that you want to own a VPS. Share this article the author in practice some experience, we can give those who build their own VPS friends a little help.
Preparatory
Need to buy a VPS with root privileges, then it purchased 512 M memory 5 G SSD, 500 G flow / month, 9.99 knife each year, but it seems now that low-cost packages over. Interested friends can look at other companies or other packages of VPS. Some friends said that some very fast, watch YouTube directly to 1440p, but I have not tested, currently my VPS speed can meet my needs, and DO the price is more expensive.
The figure is the use of SS and take IPsec VPN services, for reference only:
Usage
Usage
After the server purchase, installation CentOS7, because these tutorials are based CentOS7, install a new OS, moving tile union Tell your SSH port and root password, which they can not be customized, if you really want to remember the forgotten You can also reset the root password, or directly using sSH to log online to move bricklayer operation can also be provided, that is, the reaction is relatively slow, so after we commonly ssh login to configure the VPS, Mac is like under the direct use of the terminal, the next win on their own Looking for a tool like ssh.
Login ssh command:
$ Ssh-p vps port number address root @ vpsIP
After the login as equivalent in local operation, you can use various Linux commands to operate.
Configure the firewall
If SSH can not sign, it means the firewall turned off SSH port, you need to log in via SSH online turn off the firewall reconfiguration.
Clear Firewall Configuration
$ Iptables -F
Clear iptabels all entries, while nat did not set, but we will follow the script configuration, do not worry. If SSH login normally do not control the firewall.
Installation firewalld
$ Yum install firewalld firewall-config
$ Systemctl start firewalld
P.S. I was in after installing firewalld then start the service has failed is displayed, and then restart the server can again start firewalld normal service, and have friends in similar situations can restart the server.
Modify the SSH port
$ Vi / usr / lib / firewalld / services / ssh.xml
Will appear the following contents:
Xml version = "1.0" encoding = "utf-8"?>
SSH short>
Secure Shell (SSH) is a protocol for logging into and executing commands on remote machines. It provides secure encrypted communications. If you plan on accessing your machine remotely via SSH over a firewalled interface, enable this option. You need the openssh -server package installed for this option to be useful. description>
Service>
The port = "22", modified to move bricklayer gives you the port number, and then reload firewalld on OK.
vi command: Press the "i" is in edit mode, after editing press "esc" to exit edit mode, then press Shift enter ":" and "wq" to save and exit vi.
$ Firewall-cmd --permanent --add-service = ssh
$ Firewall-cmd --reload
OK, now preparations are in place, the installation source, install a firewall is configured, the next step began to build the service.
Build Shadowsocks Service
This service is the simplest and most commonly used.
Mounting assembly
$ Yum install m2crypto python-setuptools
$ Easy_install pip
$ Pip install shadowsocks
When you install some components need to enter Y to confirm. VPS small memory components can be installed separately.
Server configuration parameters after installation
$ Vi / etc / shadowsocks.json
Written as follows:
{
"Server": "0.0.0.0",
"Server_port": 8388,
"Local_address": "127.0.0.1",
"Local_port": 1080,
"Password": "mypassword",
"Timeout": 300,
"Method": "aes-256-cfb",
"Fast_open": false,
"Workers": 1
}
Will replace the above mypassword as your password, server_port also can be modified, for example, 443 is Shadowsocks client default port number.
If you need to change the port, you need to open ports in the firewall in response, with firewalld operation is relatively simple:
$ Vi / usr / lib / firewalld / services / ss.xml
Paste the following code into it:
|
|
|
|