How to add or remove a Superuser from Linux/Cpanel

We are to create or delete users on daily bases in our servers or online systems, so this aspects make it more necessery to understand how we can create, add, delete or recreate a user in cpanel through command line in Putty or any software like putty.



There are different different operating system in linux as well so these command might be a bit different for all the systems, first of all we will discuss CENTOS

Let me tell you how we can add or remove a user or superuser in CentOS

To add a user

useradd (user name you want to create or add without quots)

To give user a password

passwd (user name without quots)

Now if you want to allow or assign any special directory, use below command according to the directory you want to assign.

useradd (user name without quots) -d /home/(user name without quots)


Now your user has been created successfully with assigning special directory as well, now we can delete or remove that or any other user as well, let see how.

userdel (user name without quots)

this command remove only the user but if you want to remove all the things related to that user, you may use below given command.

userdel -r (user name without quots)

 

How and where that info for user stored in Linux system or what is the path to Superuser or a user in Linux

All the information regarding users is stored under this path in Linux /etc/passwd in this format user:x:UID:GID:comment:homedir:shell

Here user is the username, you use to login x is used for password info, UID is User ID, GID is Group ID, homedir shows the home directory of the user.

=====================================================================

 

For Dabian Or Ubuntu Systems, you may use below given commands for adding or deleting any user.

user:~$ sudo adduser  (user name without quots)
[sudo] password for user:
Adding user ` (user name without quots)‘ …
Adding new group ` (user name without quots)‘ (1001) …
Adding new user ` (user name without quots)‘ (1001) with group ` (user name without quots)‘ …
Creating home directory `/home/ (user name without quots)‘ …
Copying files from `/etc/skel’ …
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for  (user name)
Enter the new value, or press ENTER for the default
Full Name []: Your Name
Room Number []: 007
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]

 

Add a Comment

*