VMWare and Sudo

Below is how to setup sudo access for users on VMWare ESX servers.  This is standard for any Linux distribution.  Just for reference, VMWare ESX v* runs on top of Redhat Linux.

[___ @vm]# cat /etc/redhat-release
Red Hat Enterprise Linux ES release 3 (Taroon)

First, su to root
[user@vm03 user]$ su -
Password:

Next, edit /etc/sudoers
[___ @vm]# vi /etc/sudoers

For an individual user, add the following
user ALL=(ALL) ALL

Or you can setup a group and all users within will inherit sudo rights
%admins        ALL=(ALL)       ALL

Save the configuration with vi hit escape then type “:wq!” and enter.

Test
[user@vm03 user]$ sudo su -
Password:
[vm]# whoami
root

Note: This will allow the user to become or execute commands as root without needing to know the root password.  Still, the user will be prompted for their password when they use sudo.  More granular access is possible allowing users to execute only specific commands.  If you want to bypass all password authentication (not a good idea) for sudo access, you can use NOPASSWD.

user  ALL=(ALL)       NOPASSWD: ALL

Advertisement

~ by Kevin Goodman on November 3, 2008.

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 1,031 other followers