Creating a super user with root rights

Sudo is a program which can be used by normal users to execute programs as super user or any other user. Sudo access is controlled by /etc/sudoers. The users listed in /etc/sudoers file can execute commands with an effective user id of 0 and a group id of root's group.

The file '/etc/sudoers' should be edited with the editor "visudo".

01. First, create a user called "uddika"
[root@daddylinux~]#useradd uddika
[root@daddylinux~]#passwd uddika

02. To give a specific group of users limited root privileges, edit the file with visudo as follows:
[root@daddylinux~]# visudo

03. Go down to the line # User privilege specificationand add the following line.
uddika ALL=(ALL) ALL

9 comments:

  1. This doesn't seem to actually work on CentOS 6.2. If you think it does, please publish keystroke-by-keystroke directions for running on a vanilla system.

    ReplyDelete
    Replies
    1. Definitely agree with you. A vanilla install of CentOS 6.2 doesn't seem to have a "sudoers" file in /etc/ as is indicated above. And the visudo command doesn't work - presumably for a related reason.

      Delete
  2. Hellooo...the very fact these fellows cannot be listed in the sudoers file means they cannot perform any task on a console. Why? Because your command does nothing unless 'sudo' is in front AND it then asks for your p/w which - when typed in - gets the response that you're not listed in sudoers file! Round and round we go.

    ReplyDelete
  3. he meant run the command as root...

    ReplyDelete
  4. set the UID:GUD bits to 0:0 in /etc/passwd always works.
    Say for example the new user is 'spider', then the line in passwd file should look like:

    spider:x:0:0::/home/spider:/sbin/nologin

    ReplyDelete
  5. its nice..but i want to be add multiple users in visudo file...act like root user....what i will do?

    ReplyDelete
  6. first enter su -
    put in the password used during installation
    input above commands
    visudo should now work as well

    ReplyDelete
  7. pidarasnja ne pokazivajuwaja kommenti...

    ReplyDelete