Quantcast
Channel: How to use sudo -u option? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

How to use sudo -u option?

$
0
0

I have 2 users, userA and userB. userB needs to run some commands as userA. I have specified these options in /etc/sudoers as below:

userA ALL=(ALL) ALL
userB ALL=(vinoth) /sbin/fdisk

I ran this command as userB:

sudo -u userA fdisk -l 

It asked for the password of userB. Once I entered the password, the command didn't give the fdisk output.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>