How can I install sudo without using su? [duplicate]
Clash Royale CLAN TAG#URR8PPP
This question already has an answer here:
Can sudo be reinstalled after being removed?
7 answers
I need to use sudo but when I try to use it, a prompt tells me the command is not found and I need to install sudo.
So when I switch to su so I can gain root access to install sudo, it says auth failure
How can I fix this?
18.04 sudo su administrator
marked as duplicate by Kulfy, Pilot6, karel, Zanna, dessert Mar 1 at 19:33
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Can sudo be reinstalled after being removed?
7 answers
I need to use sudo but when I try to use it, a prompt tells me the command is not found and I need to install sudo.
So when I switch to su so I can gain root access to install sudo, it says auth failure
How can I fix this?
18.04 sudo su administrator
marked as duplicate by Kulfy, Pilot6, karel, Zanna, dessert Mar 1 at 19:33
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3
You might need to enter the recovery mode at the Grub menu, select the 'root shell', and try installing sudo. Not sure will work though. Obviously, sudo is preinstalled by default, and removing it was a bad idea.
– mikewhatever
Mar 1 at 11:26
See also: unix.stackexchange.com/q/333061/140314
– OldBunny2800
Mar 1 at 16:14
It's ironic how it suggests to usesudo
to installsudo
. Even more ironic that it would probably suggest the same thing again if you actually typed the command it had suggested to you.
– kasperd
Mar 2 at 10:41
add a comment |
This question already has an answer here:
Can sudo be reinstalled after being removed?
7 answers
I need to use sudo but when I try to use it, a prompt tells me the command is not found and I need to install sudo.
So when I switch to su so I can gain root access to install sudo, it says auth failure
How can I fix this?
18.04 sudo su administrator
This question already has an answer here:
Can sudo be reinstalled after being removed?
7 answers
I need to use sudo but when I try to use it, a prompt tells me the command is not found and I need to install sudo.
So when I switch to su so I can gain root access to install sudo, it says auth failure
How can I fix this?
This question already has an answer here:
Can sudo be reinstalled after being removed?
7 answers
18.04 sudo su administrator
18.04 sudo su administrator
edited Mar 1 at 11:56
Kulfy
5,03651744
5,03651744
asked Mar 1 at 11:20
Gijs ClaesGijs Claes
161
161
marked as duplicate by Kulfy, Pilot6, karel, Zanna, dessert Mar 1 at 19:33
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Kulfy, Pilot6, karel, Zanna, dessert Mar 1 at 19:33
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
3
You might need to enter the recovery mode at the Grub menu, select the 'root shell', and try installing sudo. Not sure will work though. Obviously, sudo is preinstalled by default, and removing it was a bad idea.
– mikewhatever
Mar 1 at 11:26
See also: unix.stackexchange.com/q/333061/140314
– OldBunny2800
Mar 1 at 16:14
It's ironic how it suggests to usesudo
to installsudo
. Even more ironic that it would probably suggest the same thing again if you actually typed the command it had suggested to you.
– kasperd
Mar 2 at 10:41
add a comment |
3
You might need to enter the recovery mode at the Grub menu, select the 'root shell', and try installing sudo. Not sure will work though. Obviously, sudo is preinstalled by default, and removing it was a bad idea.
– mikewhatever
Mar 1 at 11:26
See also: unix.stackexchange.com/q/333061/140314
– OldBunny2800
Mar 1 at 16:14
It's ironic how it suggests to usesudo
to installsudo
. Even more ironic that it would probably suggest the same thing again if you actually typed the command it had suggested to you.
– kasperd
Mar 2 at 10:41
3
3
You might need to enter the recovery mode at the Grub menu, select the 'root shell', and try installing sudo. Not sure will work though. Obviously, sudo is preinstalled by default, and removing it was a bad idea.
– mikewhatever
Mar 1 at 11:26
You might need to enter the recovery mode at the Grub menu, select the 'root shell', and try installing sudo. Not sure will work though. Obviously, sudo is preinstalled by default, and removing it was a bad idea.
– mikewhatever
Mar 1 at 11:26
See also: unix.stackexchange.com/q/333061/140314
– OldBunny2800
Mar 1 at 16:14
See also: unix.stackexchange.com/q/333061/140314
– OldBunny2800
Mar 1 at 16:14
It's ironic how it suggests to use
sudo
to install sudo
. Even more ironic that it would probably suggest the same thing again if you actually typed the command it had suggested to you.– kasperd
Mar 2 at 10:41
It's ironic how it suggests to use
sudo
to install sudo
. Even more ironic that it would probably suggest the same thing again if you actually typed the command it had suggested to you.– kasperd
Mar 2 at 10:41
add a comment |
1 Answer
1
active
oldest
votes
Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this:
If instead you get options like:
You need to go to Advanced Options using arrow keys and hit Enter and then choose the recovery mode
Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.
Now you should see this menu:
Using the arrow keys scroll down to network and hit Enter to enable networking. If asked to remount the partition, hit Enter on yes.
And then go to root in the same menu and then hit Enter.
You should now see a root prompt, something like this:
root@gijs-pc:~#
At this stage you might have a read-only filesystem. You have to remount it with write permissions:
mount -o remount,rw /
now, install sudo
by:
apt install sudo
check your sudo settings once again by:
visudo
also, check if your account gijs
is a member of sudo
If not, add him as a member of sudo and wheel group by:
usermod -aG sudo gijs
usermod -aG wheel gijs
Now, you may restart and you now should have access to sudo.
This answer is abridged version of Jorge Castro's answer on How do I reset a lost administrative password?
2
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
1
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this:
If instead you get options like:
You need to go to Advanced Options using arrow keys and hit Enter and then choose the recovery mode
Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.
Now you should see this menu:
Using the arrow keys scroll down to network and hit Enter to enable networking. If asked to remount the partition, hit Enter on yes.
And then go to root in the same menu and then hit Enter.
You should now see a root prompt, something like this:
root@gijs-pc:~#
At this stage you might have a read-only filesystem. You have to remount it with write permissions:
mount -o remount,rw /
now, install sudo
by:
apt install sudo
check your sudo settings once again by:
visudo
also, check if your account gijs
is a member of sudo
If not, add him as a member of sudo and wheel group by:
usermod -aG sudo gijs
usermod -aG wheel gijs
Now, you may restart and you now should have access to sudo.
This answer is abridged version of Jorge Castro's answer on How do I reset a lost administrative password?
2
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
1
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
add a comment |
Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this:
If instead you get options like:
You need to go to Advanced Options using arrow keys and hit Enter and then choose the recovery mode
Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.
Now you should see this menu:
Using the arrow keys scroll down to network and hit Enter to enable networking. If asked to remount the partition, hit Enter on yes.
And then go to root in the same menu and then hit Enter.
You should now see a root prompt, something like this:
root@gijs-pc:~#
At this stage you might have a read-only filesystem. You have to remount it with write permissions:
mount -o remount,rw /
now, install sudo
by:
apt install sudo
check your sudo settings once again by:
visudo
also, check if your account gijs
is a member of sudo
If not, add him as a member of sudo and wheel group by:
usermod -aG sudo gijs
usermod -aG wheel gijs
Now, you may restart and you now should have access to sudo.
This answer is abridged version of Jorge Castro's answer on How do I reset a lost administrative password?
2
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
1
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
add a comment |
Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this:
If instead you get options like:
You need to go to Advanced Options using arrow keys and hit Enter and then choose the recovery mode
Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.
Now you should see this menu:
Using the arrow keys scroll down to network and hit Enter to enable networking. If asked to remount the partition, hit Enter on yes.
And then go to root in the same menu and then hit Enter.
You should now see a root prompt, something like this:
root@gijs-pc:~#
At this stage you might have a read-only filesystem. You have to remount it with write permissions:
mount -o remount,rw /
now, install sudo
by:
apt install sudo
check your sudo settings once again by:
visudo
also, check if your account gijs
is a member of sudo
If not, add him as a member of sudo and wheel group by:
usermod -aG sudo gijs
usermod -aG wheel gijs
Now, you may restart and you now should have access to sudo.
This answer is abridged version of Jorge Castro's answer on How do I reset a lost administrative password?
Boot up the machine, and after the BIOS screen, hold down the left Shift key. You will then be prompted by a menu that looks something like this:
If instead you get options like:
You need to go to Advanced Options using arrow keys and hit Enter and then choose the recovery mode
Hit the down arrow until you select the 2nd entry from the top (the one with the recovery mode in the description) and then hit Enter.
Now you should see this menu:
Using the arrow keys scroll down to network and hit Enter to enable networking. If asked to remount the partition, hit Enter on yes.
And then go to root in the same menu and then hit Enter.
You should now see a root prompt, something like this:
root@gijs-pc:~#
At this stage you might have a read-only filesystem. You have to remount it with write permissions:
mount -o remount,rw /
now, install sudo
by:
apt install sudo
check your sudo settings once again by:
visudo
also, check if your account gijs
is a member of sudo
If not, add him as a member of sudo and wheel group by:
usermod -aG sudo gijs
usermod -aG wheel gijs
Now, you may restart and you now should have access to sudo.
This answer is abridged version of Jorge Castro's answer on How do I reset a lost administrative password?
edited Mar 1 at 17:40
answered Mar 1 at 11:41
Varun ChhanganiVarun Chhangani
137110
137110
2
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
1
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
add a comment |
2
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
1
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
2
2
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
Maybe you should enable network before dropping to root shell !!
– Soren A
Mar 1 at 11:50
1
1
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
Hmm.. Indeed as @Olorin said, It is a duplicate. Surely, we can use pkexec too
– Varun Chhangani
Mar 1 at 12:25
add a comment |
3
You might need to enter the recovery mode at the Grub menu, select the 'root shell', and try installing sudo. Not sure will work though. Obviously, sudo is preinstalled by default, and removing it was a bad idea.
– mikewhatever
Mar 1 at 11:26
See also: unix.stackexchange.com/q/333061/140314
– OldBunny2800
Mar 1 at 16:14
It's ironic how it suggests to use
sudo
to installsudo
. Even more ironic that it would probably suggest the same thing again if you actually typed the command it had suggested to you.– kasperd
Mar 2 at 10:41