Tencent Cloud Server Initialization
This article was last updated on: May 17, 2026 am
Reinstall the OS
│ 📓 Note:
│
│ When I purchased the server, the latest CentOS version available was only 7.3, but I wanted to use CentOS 7.5. I found it in the image repository (why wasn’t it offered at purchase time?), so I decided to reinstall the OS.
- Select the instance, click More, then choose Reinstall OS:

- Select Public Image -> CentOS -> CentOS 7.5 64-bit -> enter the root password. Click Start Reinstallation. As shown below:

- Wait for the reinstallation to complete.
Configure Monitoring and Alerting
- Click the Monitoring icon:

-
The following metrics are available, as shown below. Click Set Alert:
- CPU
- Memory
- Bandwidth (internal/external)
- Disk IO
- Partition usage

- Customize the alert policy based on your needs. Example below:

- To configure alert notification channels, you need to create a user group first. As shown below (I share the server with others, so creating a user group is necessary):

- To create a user group, simply use the preset policy — Administrator — for now.

- Next, associate it with the specific user group.

- Click Done. The configuration result is shown below (you can disable the default policy):

Create SSH Key and Bind to Instance
- In the SSH Key menu, click Create Key:

- Create the key (❗ Keep the private key safe and do not share it).

- After creation, shut down the instance first (only a stopped instance can be bound to a key — nice, the shutdown also triggered an alert 👌), then select Bind/Unbind Instance, as shown below:

Security Group Configuration
│ 📓 Note:
│
│ Similar to firewall rules.
- Click Security Group -> Create. As shown below:

- Select Set Rules Now. Reasons shown below:

- Associate it with your cloud server instance. As shown below:

-
Then configure inbound/outbound rules. Start with inbound rules and select Quick Allow. This opens the following ports:
- Linux SSH login: port 22
- Windows login: port 3389
- Ping: ICMP protocol
- HTTP: port 80
- HTTPS: port 443
- FTP: ports 20 and 21

- Add custom rules as needed. For example, allow TCP port 8000:

- Finally, configure outbound rules and select Quick Allow. You can refine them later. As shown below:

At this point, the console configuration is mostly done. Next, log in to the server for further configuration.
CentOS 7.5 Optimization
User / Login Optimization
Create a Regular User with Public Key Authentication
-
Create a regular user: useradd -m -p yourpassword casey
-
Set up public key authentication for the regular user (since we already created and bound the SSH key earlier, the public key already exists on the server — just copy it):
1
cp /root/.ssh/authorized_keys /home/casey/.ssh && chown -R casey:casey /home/casey/.ssh/ -
Verify that SSH public key authentication works.
│ 📓 Note:
│
│ The complete steps for public key authentication are as follows (assuming the account can initially log in with username and password):
│
│ 1. Create a regular user on the cloud server: useradd -m -p yourpassword hellowordomain
│ 2. Generate a key pair on the cloud server using ssh-keygen: ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa_tencent_$(date +%Y-%m-%d) -C “tencent key for hellowordomain”
│ 3. Install the public key using ssh-copy-id: ssh-copy-id -i /path/to/public-key-file user@host
│ 4. Verify that SSH public key authentication works.
Configure sudo Privileges for the Regular User
How to add a user to the sudo group on CentOS/RHEL
On CentOS/RHEL and Fedora, users in the wheel group are allowed to execute all commands. Use the usermod command to add user vivek to the wheel group:
1 | |
Enable passwordless sudo
1 | |
Test and verify that user vivek can execute commands as root:
1 | |
sshd_config Hardening
1 | |
Finally, test the sshd_config file and restart/reload the SSH service:
1 | |
Update System and Software
1 | |
Install and Configure Git
-
Install Git
1
sudo yum install -y --setopt=tsflags=nodocs git -
Configure Git
1
2
3git config --global user.name "east4ming"
git config --global user.email "cuikaidong@foxmail.com"
ssh-keygen -t rsa -b 4096 -C "cuikaidong@foxmail.com" # You can also reuse an existing private key -
cat .ssh/id_rsa.pub and copy the output (id_rsa.pub contains the public key).
-
Open GitHub in your browser, log in, go to account Settings, find SSH on the left sidebar, clean up any unused SSH keys, then create a new one — name it anything you like, paste in all the characters output by cat, and save.
-
Cache HTTPS credentials:
1
2$ git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)
Optimize Shell Configuration
Install zsh
1 | |
Install Powerline
1 | |
Install oh-my-zsh
1 | |
Using Oh My Zsh
│ The following content is from the oh-my-zsh GitHub repository.
Plugins
Oh My Zsh comes with a shitload of plugins to take advantage of. You can take a look in the plugins directory and/or the wikito see what’s currently available.
Enabling Plugins
Once you spot a plugin (or several) that you’d like to use with Oh My Zsh, you’ll need to enable them in the .zshrc file. You’ll find the zshrc file in your $HOME directory. Open it with your favorite text editor and you’ll see a spot to list all the plugins you want to load.
1 | |
For example, this might begin to look like this:
1 | |
Using Plugins
Most plugins (should! we’re working on this) include a README, which documents how to use them.
Themes
We’ll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one hundred themes now bundled. Most of them have screenshots on the wiki. Check them out!
Selecting a Theme
Robby’s theme is the default one. It’s not the fanciest one. It’s not the simplest one. It’s just the right one (for him).
Once you find a theme that you’d like to use, you will need to edit the ~/.zshrc file. You’ll see an environment variable (all caps) in there that looks like:
1 | |
To use a different theme, simply change the value to match the name of your desired theme. For example:
1 | |
Note: many themes require installing the Powerline Fonts in order to render properly.
Open up a new terminal window and your prompt should look something like this:

In case you did not find a suitable theme for your needs, please have a look at the wiki for more of them.
If you’re feeling feisty, you can let the computer select one randomly for you each time you open a new terminal window.
1 | |
And if you want to pick random theme from a list of your favorite themes:
ZSH_THEME_RANDOM_CANDIDATES=(
“robbyrussell”
“agnoster”
)