Install sudo for centos 5.6
# yum install sudo
# visudo
Uncomment this ( remove the # )
# %wheel ALL=(ALL) ALL
[adrotate banner=”1″]
Save and quit
:wq
To add your username
Edit the group
vi /etc/group
wheel:x:10:root,your_username
Save and quit
:wq
or
[adrotate banner=”2″]
gpasswd -a iyour_username wheel
Then you can try SSH to your server, login using your username and password, after that type
After login, then type
# sudo su -
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for MY_USERNAME:
# whoami
root
#
Confirm that you can login using your username, then disable the root login.
[adrotate banner=”1″]
passwd -l root
This applied to:
install sudo linux