I am trying to gain root user access to another user so that I can run a command with adding sudo in front of any command.
Example: fdisk -l
Getting the error message as:
fdisk: cannot open /dev/loop0: Permission denied
fdisk: cannot open /dev/loop1: Permission denied
fdisk: cannot open /dev/loop2: Permission denied
fdisk: cannot open /dev/loop3: Permission denied
I tried to give the root user access to the user with the name sudhir
.
switched to root user with su -
visudoers
Added the user as
root ALL=(ALL:ALL) ALL
sudhir ALL=(ALL:ALL) ALL
screenshot of the sudoers file
Saved with ctrl+o,
switched to user & executed the command fdisk -l
, still getting the same error.
Any idea?
sudo fdisk -l
as user sudhir. – PerlDuck Jul 10 '19 at 08:48sudo
, run as if by root? This is inadvisable; e.g., users shouldn't runfirefox
orlibreoffice
as root (nor with abilities equivalent to root's). Even if you're not concerned about security, this would make some strange and unexpected mistakes easier to make. If you still want that, I recommend you [edit] to make that clear. Otherwise, I recommend you [edit] about what you do need. Did @PerlDuck's comment answer your question? Do you wantsudo
not to require a password? Does sudhir want a root shell (as withsudo -i
)? – Eliah Kagan Jul 11 '19 at 01:17