Error-to-fix
Join Me on
  • Home
  • Blog
  • Contact

How to make a user account with root permission or how to add a user to Sudoer list.

5/7/2013

0 Comments

 
Picture
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.
---------------------------------------------------------------------------------------------------------------------------------------










0 Comments



Leave a Reply.

    Author

    Hello, Welcome to Error to fix. a name it self explain about the fixing of IT related issues. I am working in information technology since my child hood  am very passionate about the IT and day to day market trend.. More

    Categories

    All
    AWS
    Azure
    Cloud
    Error & Fixes
    GoogleCloud
    Linux
    Storage
    Virtualisation
    Windows

    Archives

    January 2020
    November 2013
    July 2013
    June 2013
    March 2013
    January 2013

    RSS Feed

Powered by Create your own unique website with customizable templates.