IT Guides, Electronics, Reviews, and more!
IT Guides, Electronics, Reviews, and more!

Root User Management via SSH in Linux/Centos

 

1. Login as root (replace localhost with your server address)

ssh root@localhost

To create a Root User Account

2. Type in this command and press enter (remember to replace <username>)

useradd -ou 0 -g 0 <username>

3. Type in this command and press enter to create a password for the user

passwd <username>

4. Type in the password for the user, press enter, and then reconfirm

5. If all goes well, a message should display

“Passwd: all authentication tokens updated succcessfully.”

To delete an existing Root User Account

2. Open /etc/passwd with something like nano editor by typing the command below and press enter

nano /etc/passwd

3. Find the desired Root User Account in the file

<username>:x:0:0::/home/<username>:/bin/sh

4. Change the UID to something else to disable root privileges, like:

<username>:x:1111:0::/home/<username>:/bin/sh

4. Save the file and exit by pressing the “Ctrl” and “x”

5. Type in “Y” and press “enter” to confirm changes

6. You can now delete the User Account by typing in, followed by enter.

userdel <username>

Leave a comment

Your email address will not be published. Required fields are marked *