Can I edit the sudoers file with visudo using my bootable USB
Something I did with a sudo dpkg ... installation in an attempt to fix problems with my audio clobbered my ability of my sole user-name to run sudo in 18.04 LTS (Bionic Beaver). This is a single OS system. I have seen advice to enter recovery mode, but my Gigabyte BIOS interface does not show such an option. It shows no recovery option among the 5 choices (three of which are Ubuntu images.) I'm writing this from a system booted from a 16.04 image on a USB stick. I first followed the advice to remount the "disk" to be writeable with:
$ mount -o remount,rw /
I think I'm able to see and edit (using visudo) the /etc/sudoers file on the SSD where my "real" system lives. I added the line:
david ALL=(ALL) ALL
... immediate after the %sudo ... line, and it was accepted by the syntax checker. So I removed the .tmp extension from the file name offered by visudo when I ctrl-O-ed out of the edit session and exited. Is this supposed to "work".
Update: It did seem to work in the sense that I can now issue sudo-requiring commands in a Terminal session, but it seems like a security hole, so I'm still wondering if I need to worry. Also wondering why I cannot get a Grub panel to display from a BIOS panel like I have read in multiple webpages and AU postings.
usb sudo password-recovery visudo
add a comment |
Something I did with a sudo dpkg ... installation in an attempt to fix problems with my audio clobbered my ability of my sole user-name to run sudo in 18.04 LTS (Bionic Beaver). This is a single OS system. I have seen advice to enter recovery mode, but my Gigabyte BIOS interface does not show such an option. It shows no recovery option among the 5 choices (three of which are Ubuntu images.) I'm writing this from a system booted from a 16.04 image on a USB stick. I first followed the advice to remount the "disk" to be writeable with:
$ mount -o remount,rw /
I think I'm able to see and edit (using visudo) the /etc/sudoers file on the SSD where my "real" system lives. I added the line:
david ALL=(ALL) ALL
... immediate after the %sudo ... line, and it was accepted by the syntax checker. So I removed the .tmp extension from the file name offered by visudo when I ctrl-O-ed out of the edit session and exited. Is this supposed to "work".
Update: It did seem to work in the sense that I can now issue sudo-requiring commands in a Terminal session, but it seems like a security hole, so I'm still wondering if I need to worry. Also wondering why I cannot get a Grub panel to display from a BIOS panel like I have read in multiple webpages and AU postings.
usb sudo password-recovery visudo
add a comment |
Something I did with a sudo dpkg ... installation in an attempt to fix problems with my audio clobbered my ability of my sole user-name to run sudo in 18.04 LTS (Bionic Beaver). This is a single OS system. I have seen advice to enter recovery mode, but my Gigabyte BIOS interface does not show such an option. It shows no recovery option among the 5 choices (three of which are Ubuntu images.) I'm writing this from a system booted from a 16.04 image on a USB stick. I first followed the advice to remount the "disk" to be writeable with:
$ mount -o remount,rw /
I think I'm able to see and edit (using visudo) the /etc/sudoers file on the SSD where my "real" system lives. I added the line:
david ALL=(ALL) ALL
... immediate after the %sudo ... line, and it was accepted by the syntax checker. So I removed the .tmp extension from the file name offered by visudo when I ctrl-O-ed out of the edit session and exited. Is this supposed to "work".
Update: It did seem to work in the sense that I can now issue sudo-requiring commands in a Terminal session, but it seems like a security hole, so I'm still wondering if I need to worry. Also wondering why I cannot get a Grub panel to display from a BIOS panel like I have read in multiple webpages and AU postings.
usb sudo password-recovery visudo
Something I did with a sudo dpkg ... installation in an attempt to fix problems with my audio clobbered my ability of my sole user-name to run sudo in 18.04 LTS (Bionic Beaver). This is a single OS system. I have seen advice to enter recovery mode, but my Gigabyte BIOS interface does not show such an option. It shows no recovery option among the 5 choices (three of which are Ubuntu images.) I'm writing this from a system booted from a 16.04 image on a USB stick. I first followed the advice to remount the "disk" to be writeable with:
$ mount -o remount,rw /
I think I'm able to see and edit (using visudo) the /etc/sudoers file on the SSD where my "real" system lives. I added the line:
david ALL=(ALL) ALL
... immediate after the %sudo ... line, and it was accepted by the syntax checker. So I removed the .tmp extension from the file name offered by visudo when I ctrl-O-ed out of the edit session and exited. Is this supposed to "work".
Update: It did seem to work in the sense that I can now issue sudo-requiring commands in a Terminal session, but it seems like a security hole, so I'm still wondering if I need to worry. Also wondering why I cannot get a Grub panel to display from a BIOS panel like I have read in multiple webpages and AU postings.
usb sudo password-recovery visudo
usb sudo password-recovery visudo
edited Dec 28 '18 at 17:14
asked Dec 28 '18 at 16:58
42-
1105
1105
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Yes it should work. Just be sure you have mounted the root partition of your system and chroot to it before running visudo.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Yes. You reminded me that I forgot to mention that I did that with:mount -o remount,rw /I will add that to my question body as well. Any idea why grub cannot be found?
– 42-
Dec 28 '18 at 17:11
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1105166%2fcan-i-edit-the-sudoers-file-with-visudo-using-my-bootable-usb%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Yes it should work. Just be sure you have mounted the root partition of your system and chroot to it before running visudo.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Yes. You reminded me that I forgot to mention that I did that with:mount -o remount,rw /I will add that to my question body as well. Any idea why grub cannot be found?
– 42-
Dec 28 '18 at 17:11
add a comment |
Yes it should work. Just be sure you have mounted the root partition of your system and chroot to it before running visudo.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Yes. You reminded me that I forgot to mention that I did that with:mount -o remount,rw /I will add that to my question body as well. Any idea why grub cannot be found?
– 42-
Dec 28 '18 at 17:11
add a comment |
Yes it should work. Just be sure you have mounted the root partition of your system and chroot to it before running visudo.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Yes it should work. Just be sure you have mounted the root partition of your system and chroot to it before running visudo.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Dec 28 '18 at 17:11
user1330614
1262
1262
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
user1330614 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Yes. You reminded me that I forgot to mention that I did that with:mount -o remount,rw /I will add that to my question body as well. Any idea why grub cannot be found?
– 42-
Dec 28 '18 at 17:11
add a comment |
Yes. You reminded me that I forgot to mention that I did that with:mount -o remount,rw /I will add that to my question body as well. Any idea why grub cannot be found?
– 42-
Dec 28 '18 at 17:11
Yes. You reminded me that I forgot to mention that I did that with:
mount -o remount,rw / I will add that to my question body as well. Any idea why grub cannot be found?– 42-
Dec 28 '18 at 17:11
Yes. You reminded me that I forgot to mention that I did that with:
mount -o remount,rw / I will add that to my question body as well. Any idea why grub cannot be found?– 42-
Dec 28 '18 at 17:11
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1105166%2fcan-i-edit-the-sudoers-file-with-visudo-using-my-bootable-usb%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown