Environment: Computer is Windows, server is Cloud Ubuntu18.04
1. Log in to the root server
Tencent cloud server, for security issues when created by default, will refuse to directly log in to root, and created a default user named Ubuntu for the user. To access the root directory, simply execute the following command:
su root
Copy the code
Do not want to enter root, how to execute root level command?
Security conscious friends may resist operating directly under root, but directly entering apt and other commands under Ubuntu account will be denied.
sudo apt update
Copy the code
3. SSH password-free login to root on the PC
Some users want to log in to the root directory. In this case, you need to modify the sshd_config configuration. Cloud.tencent.com/developer/a…
sudo vi /etc/ssh/sshd_config
Copy the code
To compare the learning curve of entering VI, I made a summary of the common commands.
# vi instruction
i Type I to enter insert mode
esc #--> Press Esc to exit insert mode
:q #--> Type :q Exit without saving
:wq #--> Type :wq to save and exit
Copy the code
Remember to remove the preceding # for it to take effect, as shown above. Add the sudo permission for the account you want to use under root. In this case, you can directly log in to the root of the server from the computer.
conclusion
- The general platform will be automated for you, you need to execute root level command directly add sudo can be.
- You need to directly log in to root from the PC and modify sshd_config.
- Log in to the root server directly from your PC using SSH