As mentioned in this question, the sudo
command in my live USB is not working. To fix this I need to run some commands. But every command I run says permission denied
. How do I gain root access? Running su -
asks for password.
Asked
Active
Viewed 3,701 times
2
1 Answers
3
As only the sudo
command is not working because of a badly configured /etc/sudoers
file, you can use pkexec
as temporary replacement:
pkexec su -
pkexec
will prompt a GUI password dialog every time you run it, it seems not to work in a TTY or when booting to text mode as it needs a dbus component.
You definitely need to fix your /etc/sudoers
file, becoming lazy and just using pkexec
from now on is not the way to go. That's not what it's made for.

Byte Commander
- 107,489
-
In that case what would be the password? I was booting from a live USB. – Yashbhatt Feb 24 '16 at 12:21
-
-
This is the login password. But when I ran
su -
, it asked for password and keeping it blank gives me "Authentication failure". – Yashbhatt Feb 26 '16 at 05:06 -
You may not run
su -
, that will ask you for the root account's password (which is deactivated). You must runsudo su -
or in your case wheresudo
is brokenpkexec su -
to become root with your own account password. – Byte Commander Feb 26 '16 at 10:17 -
Can't try it now. The pen drive is formatted. Thanks for the help though. – Yashbhatt Feb 26 '16 at 17:42
sudo
command and here I want root access. – Yashbhatt Feb 28 '16 at 14:31sudo
gives you root access. If you getsudo
to work, then you get root access. If you want to run a shell as super-user usesudo -s
orsudo -i
depending on your needs. – David Foerster Feb 28 '16 at 14:41