VMware Cloud Community
meistermn
Expert
Expert
Jump to solution

How to run esxtop command not under root user?

I want to run the esxtop command under the user vmadmin which is in the wheel group.

I tried the following commands under root user:

chgrp wheel /usr/bin/esxtop

chmod u+s /usr/bin/esxtop

chmod g+s /usr/bin/esxtop

after this logout as root and tried to run under vmadmin:

I till get the error message :

esxtop: need to run as user root

What did I wrong?

0 Kudos
1 Solution

Accepted Solutions
Texiwill
Leadership
Leadership
Jump to solution

Hello,

The line should be:

vmadmin ALL=/usr/bin/esxtop NOPASSWD

The path is very important. Login as vmadmin then run:

sudo /usr/bin/esxtop

Best regards,

Edward

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill

View solution in original post

0 Kudos
5 Replies
ZMkenzie
Enthusiast
Enthusiast
Jump to solution

You can use sudo:

run "visudo" and then add:

vmadmin ALL=/path/to/command NOPASSWD

zenariga
Enthusiast
Enthusiast
Jump to solution

The best way is using SUDO.

Try man sudo, I will see how to configure.

meistermn
Expert
Expert
Jump to solution

tried this:

used which esxtop to get to the path for esxtop

output : /etc/bin/esxtop

visudo

vmadmin ALL=/etc/bin/esxtop NOPASSWD

Then login with vmadmin

Did not work

0 Kudos
Texiwill
Leadership
Leadership
Jump to solution

Hello,

The line should be:

vmadmin ALL=/usr/bin/esxtop NOPASSWD

The path is very important. Login as vmadmin then run:

sudo /usr/bin/esxtop

Best regards,

Edward

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
meistermn
Expert
Expert
Jump to solution

I like more this line

vmadmin ALL=NOPASSWD:/usr/bin/esxtop

Login as vmadmin then run:

sudo /usr/bin/esxtop

That worked for me.

Can you explain the different lines?

vmadmin ALL=NOPASSWD:/usr/bin/esxtop and

vmadmin ALL=/usr/bin/esxtop NOPASSWD

Is it only notation.

0 Kudos