I have somehow locked or removed my access to sudo - how can I fix it? [duplicate]











up vote
1
down vote

favorite













This question already has an answer here:




  • How do I add myself back as a sudo user?

    4 answers




I am fairly new at Ubuntu system and commands. I was trying to follow some tutorial online explaining how to setup using no password to download apps. I was in visudo, and next thing I know I can't use the sudo command, nor download any software/apps.



I don't know where to start looking. If anyone could point me in the right direction, that would be an awesome way to start my weekend.










share|improve this question















marked as duplicate by karel, user68186, waltinator, Community Dec 1 at 3:13


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.















  • Have you got a link to the online tutorial? What point did you get to in it?
    – Rory Alsop
    Nov 30 at 14:47










  • Here is website i "tried" to follow the tutorial from - quora.com/…. As for what point , followed all of the steps that it had me follow. It let me run one command after i implemented the tutorial. And then , anything after that it kicks back errors if i try and run sudo.
    – Mike Dugger
    Nov 30 at 17:33

















up vote
1
down vote

favorite













This question already has an answer here:




  • How do I add myself back as a sudo user?

    4 answers




I am fairly new at Ubuntu system and commands. I was trying to follow some tutorial online explaining how to setup using no password to download apps. I was in visudo, and next thing I know I can't use the sudo command, nor download any software/apps.



I don't know where to start looking. If anyone could point me in the right direction, that would be an awesome way to start my weekend.










share|improve this question















marked as duplicate by karel, user68186, waltinator, Community Dec 1 at 3:13


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.















  • Have you got a link to the online tutorial? What point did you get to in it?
    – Rory Alsop
    Nov 30 at 14:47










  • Here is website i "tried" to follow the tutorial from - quora.com/…. As for what point , followed all of the steps that it had me follow. It let me run one command after i implemented the tutorial. And then , anything after that it kicks back errors if i try and run sudo.
    – Mike Dugger
    Nov 30 at 17:33















up vote
1
down vote

favorite









up vote
1
down vote

favorite












This question already has an answer here:




  • How do I add myself back as a sudo user?

    4 answers




I am fairly new at Ubuntu system and commands. I was trying to follow some tutorial online explaining how to setup using no password to download apps. I was in visudo, and next thing I know I can't use the sudo command, nor download any software/apps.



I don't know where to start looking. If anyone could point me in the right direction, that would be an awesome way to start my weekend.










share|improve this question
















This question already has an answer here:




  • How do I add myself back as a sudo user?

    4 answers




I am fairly new at Ubuntu system and commands. I was trying to follow some tutorial online explaining how to setup using no password to download apps. I was in visudo, and next thing I know I can't use the sudo command, nor download any software/apps.



I don't know where to start looking. If anyone could point me in the right direction, that would be an awesome way to start my weekend.





This question already has an answer here:




  • How do I add myself back as a sudo user?

    4 answers








permissions sudo visudo






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 30 at 14:47









Rory Alsop

2,4842031




2,4842031










asked Nov 30 at 14:38









Mike Dugger

62




62




marked as duplicate by karel, user68186, waltinator, Community Dec 1 at 3:13


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 karel, user68186, waltinator, Community Dec 1 at 3:13


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.














  • Have you got a link to the online tutorial? What point did you get to in it?
    – Rory Alsop
    Nov 30 at 14:47










  • Here is website i "tried" to follow the tutorial from - quora.com/…. As for what point , followed all of the steps that it had me follow. It let me run one command after i implemented the tutorial. And then , anything after that it kicks back errors if i try and run sudo.
    – Mike Dugger
    Nov 30 at 17:33




















  • Have you got a link to the online tutorial? What point did you get to in it?
    – Rory Alsop
    Nov 30 at 14:47










  • Here is website i "tried" to follow the tutorial from - quora.com/…. As for what point , followed all of the steps that it had me follow. It let me run one command after i implemented the tutorial. And then , anything after that it kicks back errors if i try and run sudo.
    – Mike Dugger
    Nov 30 at 17:33


















Have you got a link to the online tutorial? What point did you get to in it?
– Rory Alsop
Nov 30 at 14:47




Have you got a link to the online tutorial? What point did you get to in it?
– Rory Alsop
Nov 30 at 14:47












Here is website i "tried" to follow the tutorial from - quora.com/…. As for what point , followed all of the steps that it had me follow. It let me run one command after i implemented the tutorial. And then , anything after that it kicks back errors if i try and run sudo.
– Mike Dugger
Nov 30 at 17:33






Here is website i "tried" to follow the tutorial from - quora.com/…. As for what point , followed all of the steps that it had me follow. It let me run one command after i implemented the tutorial. And then , anything after that it kicks back errors if i try and run sudo.
– Mike Dugger
Nov 30 at 17:33












1 Answer
1






active

oldest

votes

















up vote
0
down vote













visudo edits the sudoers file, which defines the users and groups with administrator rights.
So It looks like you have changed `/etc/sudoers'. Now you can't edit it so only way to edit it is by running Ubuntu directly from either a USB stick or a DVD and edit it back to its original.



for that:



Boot from Ubuntu installation DVD or USB drive and choose 'Try Ubuntu without installing'. Mount the partition of your Ubuntu Installation. If you are not sure which one, launch GParted (included in the Ubuntu installation DVD or USB) or. Open a terminal (Ctrl+Alt+T) and use the following command:



sudo fdisk -l


and find out. It is usually a EXT4 Partition. Replace the XX with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.



sudo mount /dev/sdXX /mnt


XX being the partition where Ubuntu is installed.



then



sudo gedit /mnt/etc/sudoers


and edit the file as per the text here



If you want to disable password for sudo add this line



username    ALL=(ALL:ALL) NOPASSWD: ALL


below the line



%sudo   ALL=(ALL:ALL) ALL


save and



sudo umount /mnt


and



sudo reboot


Boot into your Ubuntu. Done.






share|improve this answer























  • Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
    – Mike Dugger
    Nov 30 at 19:18










  • Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
    – Hobbyist
    Nov 30 at 20:20






  • 1




    Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
    – Mike Dugger
    Dec 1 at 3:13


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













visudo edits the sudoers file, which defines the users and groups with administrator rights.
So It looks like you have changed `/etc/sudoers'. Now you can't edit it so only way to edit it is by running Ubuntu directly from either a USB stick or a DVD and edit it back to its original.



for that:



Boot from Ubuntu installation DVD or USB drive and choose 'Try Ubuntu without installing'. Mount the partition of your Ubuntu Installation. If you are not sure which one, launch GParted (included in the Ubuntu installation DVD or USB) or. Open a terminal (Ctrl+Alt+T) and use the following command:



sudo fdisk -l


and find out. It is usually a EXT4 Partition. Replace the XX with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.



sudo mount /dev/sdXX /mnt


XX being the partition where Ubuntu is installed.



then



sudo gedit /mnt/etc/sudoers


and edit the file as per the text here



If you want to disable password for sudo add this line



username    ALL=(ALL:ALL) NOPASSWD: ALL


below the line



%sudo   ALL=(ALL:ALL) ALL


save and



sudo umount /mnt


and



sudo reboot


Boot into your Ubuntu. Done.






share|improve this answer























  • Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
    – Mike Dugger
    Nov 30 at 19:18










  • Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
    – Hobbyist
    Nov 30 at 20:20






  • 1




    Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
    – Mike Dugger
    Dec 1 at 3:13















up vote
0
down vote













visudo edits the sudoers file, which defines the users and groups with administrator rights.
So It looks like you have changed `/etc/sudoers'. Now you can't edit it so only way to edit it is by running Ubuntu directly from either a USB stick or a DVD and edit it back to its original.



for that:



Boot from Ubuntu installation DVD or USB drive and choose 'Try Ubuntu without installing'. Mount the partition of your Ubuntu Installation. If you are not sure which one, launch GParted (included in the Ubuntu installation DVD or USB) or. Open a terminal (Ctrl+Alt+T) and use the following command:



sudo fdisk -l


and find out. It is usually a EXT4 Partition. Replace the XX with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.



sudo mount /dev/sdXX /mnt


XX being the partition where Ubuntu is installed.



then



sudo gedit /mnt/etc/sudoers


and edit the file as per the text here



If you want to disable password for sudo add this line



username    ALL=(ALL:ALL) NOPASSWD: ALL


below the line



%sudo   ALL=(ALL:ALL) ALL


save and



sudo umount /mnt


and



sudo reboot


Boot into your Ubuntu. Done.






share|improve this answer























  • Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
    – Mike Dugger
    Nov 30 at 19:18










  • Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
    – Hobbyist
    Nov 30 at 20:20






  • 1




    Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
    – Mike Dugger
    Dec 1 at 3:13













up vote
0
down vote










up vote
0
down vote









visudo edits the sudoers file, which defines the users and groups with administrator rights.
So It looks like you have changed `/etc/sudoers'. Now you can't edit it so only way to edit it is by running Ubuntu directly from either a USB stick or a DVD and edit it back to its original.



for that:



Boot from Ubuntu installation DVD or USB drive and choose 'Try Ubuntu without installing'. Mount the partition of your Ubuntu Installation. If you are not sure which one, launch GParted (included in the Ubuntu installation DVD or USB) or. Open a terminal (Ctrl+Alt+T) and use the following command:



sudo fdisk -l


and find out. It is usually a EXT4 Partition. Replace the XX with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.



sudo mount /dev/sdXX /mnt


XX being the partition where Ubuntu is installed.



then



sudo gedit /mnt/etc/sudoers


and edit the file as per the text here



If you want to disable password for sudo add this line



username    ALL=(ALL:ALL) NOPASSWD: ALL


below the line



%sudo   ALL=(ALL:ALL) ALL


save and



sudo umount /mnt


and



sudo reboot


Boot into your Ubuntu. Done.






share|improve this answer














visudo edits the sudoers file, which defines the users and groups with administrator rights.
So It looks like you have changed `/etc/sudoers'. Now you can't edit it so only way to edit it is by running Ubuntu directly from either a USB stick or a DVD and edit it back to its original.



for that:



Boot from Ubuntu installation DVD or USB drive and choose 'Try Ubuntu without installing'. Mount the partition of your Ubuntu Installation. If you are not sure which one, launch GParted (included in the Ubuntu installation DVD or USB) or. Open a terminal (Ctrl+Alt+T) and use the following command:



sudo fdisk -l


and find out. It is usually a EXT4 Partition. Replace the XX with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.



sudo mount /dev/sdXX /mnt


XX being the partition where Ubuntu is installed.



then



sudo gedit /mnt/etc/sudoers


and edit the file as per the text here



If you want to disable password for sudo add this line



username    ALL=(ALL:ALL) NOPASSWD: ALL


below the line



%sudo   ALL=(ALL:ALL) ALL


save and



sudo umount /mnt


and



sudo reboot


Boot into your Ubuntu. Done.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 30 at 18:24

























answered Nov 30 at 18:01









Hobbyist

1,196617




1,196617












  • Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
    – Mike Dugger
    Nov 30 at 19:18










  • Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
    – Hobbyist
    Nov 30 at 20:20






  • 1




    Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
    – Mike Dugger
    Dec 1 at 3:13


















  • Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
    – Mike Dugger
    Nov 30 at 19:18










  • Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
    – Hobbyist
    Nov 30 at 20:20






  • 1




    Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
    – Mike Dugger
    Dec 1 at 3:13
















Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
– Mike Dugger
Nov 30 at 19:18




Ok , forgive my lack of experience. But when you say run it live , is that meaning I download Unbuntu and put that on to a USB stick ? I used Rufus before and it seemed to work.
– Mike Dugger
Nov 30 at 19:18












Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
– Hobbyist
Nov 30 at 20:20




Yes that's okay. Plug in. Sart PC. From Boot menu. Boot from USB drive. Select try Ubuntu.
– Hobbyist
Nov 30 at 20:20




1




1




Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
– Mike Dugger
Dec 1 at 3:13




Ok , everything worked. Thank you so much for the advice. I have been going crazy over this. I have everything up and running!
– Mike Dugger
Dec 1 at 3:13



Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei