What is the correct way to abort an operation from the sudo password prompt? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election Results Why I closed the “Why is Kali so hard” questionSoftware installation with GUI package installer using sudo permissionWhy sudo timestamp is not updated when NOPASSWD is set?Suddenly, I Can't login with correct password (greeter & tty)Should scripts that require sudo fail if they don't have it, or use sudo and prompt?sudo for users with empty passwordsLinux Sudo Without Password PromptEcho while waiting for sudo promptDisable prompt for authentication on autocompletion of a command which needs root privilegesshell script: use sudo inside it vs run it with sudo?How to safely pass password to a remote server to execute sudo commands
Is 1 ppb equal to 1 μg/kg?
What is this single-engine low-wing propeller plane?
What would be the ideal power source for a cybernetic eye?
When is phishing education going too far?
What are 'alternative tunings' of a guitar and why would you use them? Doesn't it make it more difficult to play?
Why did the IBM 650 use bi-quinary?
How to recreate this effect in Photoshop?
Does surprise arrest existing movement?
How much radiation do nuclear physics experiments expose researchers to nowadays?
Can Pao de Queijo, and similar foods, be kosher for Passover?
macOS-like app switching in Plasma 5
Why is high voltage dangerous?
Is there a concise way to say "all of the X, one of each"?
Did Xerox really develop the first LAN?
Is it possible to boil a liquid by just mixing many immiscible liquids together?
Are my PIs rude or am I just being too sensitive?
How can I fade player when goes inside or outside of the area?
I am not a queen, who am I?
Disable hyphenation for an entire paragraph
How to assign captions for two tables in LaTeX?
How do I mention the quality of my school without bragging
Right-skewed distribution with mean equals to mode?
Does accepting a pardon have any bearing on trying that person for the same crime in a sovereign jurisdiction?
What LEGO pieces have "real-world" functionality?
What is the correct way to abort an operation from the sudo password prompt?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionSoftware installation with GUI package installer using sudo permissionWhy sudo timestamp is not updated when NOPASSWD is set?Suddenly, I Can't login with correct password (greeter & tty)Should scripts that require sudo fail if they don't have it, or use sudo and prompt?sudo for users with empty passwordsLinux Sudo Without Password PromptEcho while waiting for sudo promptDisable prompt for authentication on autocompletion of a command which needs root privilegesshell script: use sudo inside it vs run it with sudo?How to safely pass password to a remote server to execute sudo commands
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Sometimes it amazes me the "little" things I don't know about Unix. For years now I have occasionally noted that I don't actually know how to deal with the sudo password prompt cleanly. Every once in a while I sudo something only to realize that I don't actually want to run the command at all. This happens rarely enough I always forget to ask but just often enough that I remember I still haven't learned the right way to abort.
Once sudo starts asking for a password it doesn't want to give up. You can't Ctrl+C it. If you give it the right password it will run the command that I've decided I want to abort. The only solution I have found is to give it wrong passwords until it gives up asking and falls back to an su prompt which actually listens to a Ctrl+C. This feels dirty to me. It's sad enough that I changed my mind about a command; not to be able to cancel it cleanly is just embarrassing.
What is the proper way to tell sudo to abort the attempt while at the password prompt?
sudo
|
show 7 more comments
Sometimes it amazes me the "little" things I don't know about Unix. For years now I have occasionally noted that I don't actually know how to deal with the sudo password prompt cleanly. Every once in a while I sudo something only to realize that I don't actually want to run the command at all. This happens rarely enough I always forget to ask but just often enough that I remember I still haven't learned the right way to abort.
Once sudo starts asking for a password it doesn't want to give up. You can't Ctrl+C it. If you give it the right password it will run the command that I've decided I want to abort. The only solution I have found is to give it wrong passwords until it gives up asking and falls back to an su prompt which actually listens to a Ctrl+C. This feels dirty to me. It's sad enough that I changed my mind about a command; not to be able to cancel it cleanly is just embarrassing.
What is the proper way to tell sudo to abort the attempt while at the password prompt?
sudo
7
Ctrl-cexits for me in bash and zsh...
– jasonwryan
Jul 1 '14 at 7:26
@jasonwryan Now that's interesting. I wonder what is different about our configs. That would certainly seem like the obvious thing to do but it doesn't work on any of my systems.
– Caleb
Jul 1 '14 at 7:29
Tested on Arch and Debian. Nothing I can see insudoersthat would account for it.
– jasonwryan
Jul 1 '14 at 7:34
This is the closest thing I could find: ubuntuforums.org/showthread.php?t=1455643
– jasonwryan
Jul 1 '14 at 8:57
1
@ryekayo I'm confused about the "right" approach as well (hence asking this). It seems like it should respond to the firstCtrl+Cand for many people it is, but in some situations it obviously isn't. I have not figured out the difference yet.
– Caleb
Jul 1 '14 at 13:06
|
show 7 more comments
Sometimes it amazes me the "little" things I don't know about Unix. For years now I have occasionally noted that I don't actually know how to deal with the sudo password prompt cleanly. Every once in a while I sudo something only to realize that I don't actually want to run the command at all. This happens rarely enough I always forget to ask but just often enough that I remember I still haven't learned the right way to abort.
Once sudo starts asking for a password it doesn't want to give up. You can't Ctrl+C it. If you give it the right password it will run the command that I've decided I want to abort. The only solution I have found is to give it wrong passwords until it gives up asking and falls back to an su prompt which actually listens to a Ctrl+C. This feels dirty to me. It's sad enough that I changed my mind about a command; not to be able to cancel it cleanly is just embarrassing.
What is the proper way to tell sudo to abort the attempt while at the password prompt?
sudo
Sometimes it amazes me the "little" things I don't know about Unix. For years now I have occasionally noted that I don't actually know how to deal with the sudo password prompt cleanly. Every once in a while I sudo something only to realize that I don't actually want to run the command at all. This happens rarely enough I always forget to ask but just often enough that I remember I still haven't learned the right way to abort.
Once sudo starts asking for a password it doesn't want to give up. You can't Ctrl+C it. If you give it the right password it will run the command that I've decided I want to abort. The only solution I have found is to give it wrong passwords until it gives up asking and falls back to an su prompt which actually listens to a Ctrl+C. This feels dirty to me. It's sad enough that I changed my mind about a command; not to be able to cancel it cleanly is just embarrassing.
What is the proper way to tell sudo to abort the attempt while at the password prompt?
sudo
sudo
edited Jul 1 '14 at 12:51
Caleb
asked Jul 1 '14 at 7:20
CalebCaleb
51.9k9151194
51.9k9151194
7
Ctrl-cexits for me in bash and zsh...
– jasonwryan
Jul 1 '14 at 7:26
@jasonwryan Now that's interesting. I wonder what is different about our configs. That would certainly seem like the obvious thing to do but it doesn't work on any of my systems.
– Caleb
Jul 1 '14 at 7:29
Tested on Arch and Debian. Nothing I can see insudoersthat would account for it.
– jasonwryan
Jul 1 '14 at 7:34
This is the closest thing I could find: ubuntuforums.org/showthread.php?t=1455643
– jasonwryan
Jul 1 '14 at 8:57
1
@ryekayo I'm confused about the "right" approach as well (hence asking this). It seems like it should respond to the firstCtrl+Cand for many people it is, but in some situations it obviously isn't. I have not figured out the difference yet.
– Caleb
Jul 1 '14 at 13:06
|
show 7 more comments
7
Ctrl-cexits for me in bash and zsh...
– jasonwryan
Jul 1 '14 at 7:26
@jasonwryan Now that's interesting. I wonder what is different about our configs. That would certainly seem like the obvious thing to do but it doesn't work on any of my systems.
– Caleb
Jul 1 '14 at 7:29
Tested on Arch and Debian. Nothing I can see insudoersthat would account for it.
– jasonwryan
Jul 1 '14 at 7:34
This is the closest thing I could find: ubuntuforums.org/showthread.php?t=1455643
– jasonwryan
Jul 1 '14 at 8:57
1
@ryekayo I'm confused about the "right" approach as well (hence asking this). It seems like it should respond to the firstCtrl+Cand for many people it is, but in some situations it obviously isn't. I have not figured out the difference yet.
– Caleb
Jul 1 '14 at 13:06
7
7
Ctrl-c exits for me in bash and zsh...– jasonwryan
Jul 1 '14 at 7:26
Ctrl-c exits for me in bash and zsh...– jasonwryan
Jul 1 '14 at 7:26
@jasonwryan Now that's interesting. I wonder what is different about our configs. That would certainly seem like the obvious thing to do but it doesn't work on any of my systems.
– Caleb
Jul 1 '14 at 7:29
@jasonwryan Now that's interesting. I wonder what is different about our configs. That would certainly seem like the obvious thing to do but it doesn't work on any of my systems.
– Caleb
Jul 1 '14 at 7:29
Tested on Arch and Debian. Nothing I can see in
sudoers that would account for it.– jasonwryan
Jul 1 '14 at 7:34
Tested on Arch and Debian. Nothing I can see in
sudoers that would account for it.– jasonwryan
Jul 1 '14 at 7:34
This is the closest thing I could find: ubuntuforums.org/showthread.php?t=1455643
– jasonwryan
Jul 1 '14 at 8:57
This is the closest thing I could find: ubuntuforums.org/showthread.php?t=1455643
– jasonwryan
Jul 1 '14 at 8:57
1
1
@ryekayo I'm confused about the "right" approach as well (hence asking this). It seems like it should respond to the first
Ctrl+C and for many people it is, but in some situations it obviously isn't. I have not figured out the difference yet.– Caleb
Jul 1 '14 at 13:06
@ryekayo I'm confused about the "right" approach as well (hence asking this). It seems like it should respond to the first
Ctrl+C and for many people it is, but in some situations it obviously isn't. I have not figured out the difference yet.– Caleb
Jul 1 '14 at 13:06
|
show 7 more comments
1 Answer
1
active
oldest
votes
You can do this with a Ctrl + D.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f140110%2fwhat-is-the-correct-way-to-abort-an-operation-from-the-sudo-password-prompt%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
You can do this with a Ctrl + D.
add a comment |
You can do this with a Ctrl + D.
add a comment |
You can do this with a Ctrl + D.
You can do this with a Ctrl + D.
answered Mar 4 at 9:55
Clément DUGALClément DUGAL
84
84
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f140110%2fwhat-is-the-correct-way-to-abort-an-operation-from-the-sudo-password-prompt%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
7
Ctrl-cexits for me in bash and zsh...– jasonwryan
Jul 1 '14 at 7:26
@jasonwryan Now that's interesting. I wonder what is different about our configs. That would certainly seem like the obvious thing to do but it doesn't work on any of my systems.
– Caleb
Jul 1 '14 at 7:29
Tested on Arch and Debian. Nothing I can see in
sudoersthat would account for it.– jasonwryan
Jul 1 '14 at 7:34
This is the closest thing I could find: ubuntuforums.org/showthread.php?t=1455643
– jasonwryan
Jul 1 '14 at 8:57
1
@ryekayo I'm confused about the "right" approach as well (hence asking this). It seems like it should respond to the first
Ctrl+Cand for many people it is, but in some situations it obviously isn't. I have not figured out the difference yet.– Caleb
Jul 1 '14 at 13:06