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

Latest Images

Trending Articles





Latest Images