Let's say I have two user accounts:
- user (without any sudo permissions)
- user_with_sudo (with all sudo permissions)
Now, I'm logged in as user
but want to do something as root
, e.g. switch to a full root Bash. sudo -s
won't work because I'm not a sudoer.
So, I first have to switch to a sudoer user:
su user_with_sudo
And enter the password.
Now I'm logged in as user_with_sudo
and I'm able to call sudo -s
but I have to enter the same password again, which is a little bit annoying.
Is there a command, which switches to a sudoer-user and runs a command as root
with only typing the password once? Basically, is there an one-command replacement for:
su user_with_sudo
(enter password)
sudo -s
(enter same password again)
user_with_sudo
, why not just give them the root password?