sudo on CentOS

  • Switch to root and install sudo first.

[code]yum install sudo[/code]

  • Edit /etc/sudoers, find below text and add your username:

[bash]
## Next comes the main part: which users can run what software on
## which machines (the sudoers file can be shared between multiple
## systems).
## Syntax:
##
## user MACHINE=COMMANDS
##
## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
cartman ALL=(ALL) ALL[/bash]

  • Now, enjoy your sudo journey!
Written on June 12, 2010