Thursday 29 May 2014

Steps to become a root user in CentOS 6




You can user any of the following commands to change to the root user, provided you have the root password:

# su - root

OR

# su root

OR

# su -

OR

# su



Easy and dirty way for your user to run commands with root privileges is to add the following line to /etc/sudoers:

user1    ALL=(ALL)    ALL

You may do this using either visudo command, or by opening the /etc/sudoers file in your favorite text editor. You will of course need to be root.

# su - root
# visudo

OR

# su - root
# vi /etc/sudoers



You can prefix every command you want to run with root privileges with "sudo". You will be asked for your user's password, and not the root password.

You can also open a root shell by using the command:

# sudo -s


No comments:

Post a Comment