Hello guys, Today i would like to share an informative topic,As we all work in a test lab by using the root user. which is not a good practise
so we have to add a account to the Suoder list if you wants to work as a root.
You can add a user to the Suoder list by following the below simple steps . So lets us start now .
Before we proceed to Add the user to the list we have some prerequisites to check.
Create the User with the following account
Step 1 : useradd <user name>
Step 2 : You must login as a Root to add the user to the Suoder list
Step 3 : To edit the Suoder list we have to change the permissions from read only to read and write.
So lets start to change the file permission to suoder file by
[root@test ~]# ls -la /etc/sudoers
Out put as : -r--r----- 1 root root 4959 Jul 5 22:23 /etc/sudoers
Change the permission by giving write permission to the sudoer file with the below command
[root@test ~]# chmod 700 /etc/sudoers
Out put as : -rwx------ 1 root root 4959 Jul 5 22:23 /etc/sudoers
Now open the Sudoer file with the below command.
gedit /etc/sudoers
now we Add the command under ##Allow root to run commands anywhere with the below format.
<Username> ALL=(ALL) ALL
After adding the user to the suoder list change the permission back to readonly with the below command
[root@test ~]# chmod 440 /etc/sudoers
[root@test Desktop]# ls -la /etc/sudoers
Output : -r--r----- 1 root root 4959 Jul 5 22:23 /etc/sudoers
Thanks and please dont forget to leave the comments its very valuable for me.
---------------------------------------------------------------------------------------------------------------------------------------
so we have to add a account to the Suoder list if you wants to work as a root.
You can add a user to the Suoder list by following the below simple steps . So lets us start now .
Before we proceed to Add the user to the list we have some prerequisites to check.
Create the User with the following account
Step 1 : useradd <user name>
Step 2 : You must login as a Root to add the user to the Suoder list
Step 3 : To edit the Suoder list we have to change the permissions from read only to read and write.
So lets start to change the file permission to suoder file by
[root@test ~]# ls -la /etc/sudoers
Out put as : -r--r----- 1 root root 4959 Jul 5 22:23 /etc/sudoers
Change the permission by giving write permission to the sudoer file with the below command
[root@test ~]# chmod 700 /etc/sudoers
Out put as : -rwx------ 1 root root 4959 Jul 5 22:23 /etc/sudoers
Now open the Sudoer file with the below command.
gedit /etc/sudoers
now we Add the command under ##Allow root to run commands anywhere with the below format.
<Username> ALL=(ALL) ALL
After adding the user to the suoder list change the permission back to readonly with the below command
[root@test ~]# chmod 440 /etc/sudoers
[root@test Desktop]# ls -la /etc/sudoers
Output : -r--r----- 1 root root 4959 Jul 5 22:23 /etc/sudoers
Thanks and please dont forget to leave the comments its very valuable for me.
---------------------------------------------------------------------------------------------------------------------------------------