Get the App
SLTechnology News&Howtos  ›  Servers  › 

The method of creating root users on EC2 and logging in using root users

Shulou Source: shulou.com Published: 2022-06-01 17:04:19 10月30日 Update

This article mainly introduces "the method of creating root users on EC2 and using root users to log in". In the daily operation, I believe that many people have doubts about the methods of creating root users on EC2 and logging in using root users. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "creating root users on EC2 and using root users to log in". Next, please follow the editor to study!

Today, when I started studying Amazon's cloud host EC2, I encountered a problem. I need to install tomcat on EC2, but the yum command can only be run by root users, and EC2 is logged in as ec2-user users by default, so you need to switch to root users to log in. The research results are published as follows:

1. Log in and connect to the EC2 server according to the method provided on the official website (the official website recommends that windows users use PUTTY connection)

2. Enter the following command to create the password for root:

Sudo passwd root

3. Then you will be prompted to enter new password. Enter a password for the root you want to set, and you need to type it again to verify it.

4. Next, switch to root identity and enter the following command:

Su root

5. Use root identity to edit the ssh login method of Amazon CVM, find PasswordAuthentication no, and change no to yes. Enter:

Vim / etc/ssh/sshd_config

6. Next, to restart sshd, use the following command:

Sudo / sbin/service sshd restart

7. Then switch to root identity

Su root

8. Add the login password to the original "ec2-user". The following command:

Passwd ec2-user

Press the prompt to enter the password twice. At this point, you can log in to EC2's server directly with your root identity.

At this point, the study on "how to create root users on EC2 and log in using root users" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: User login input method command password identity learning next switch host more server problem Yama Amazon help prompt service research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MariaDB OPPO Reno NVidia Shulou Technology