Sudo hangs without prompting for password
I just did a fresh install of Ubuntu and now when I try to use sudo in the terminal emulator, it just hangs there without even asking me for a password.
If I switch to the terminal (Ctrl + Alt + F1) and login, sudo works as expected.
Can someone help me to figure this out?
sudo
add a comment |
I just did a fresh install of Ubuntu and now when I try to use sudo in the terminal emulator, it just hangs there without even asking me for a password.
If I switch to the terminal (Ctrl + Alt + F1) and login, sudo works as expected.
Can someone help me to figure this out?
sudo
Just a thought, have you changed the character encoding of your terminal (Open Terminal, menu Terminal -> Set Character Encoding)
– hytromo
Jul 29 '13 at 19:21
No, I haven't, but I am curious as to why that would change anything.
– Lawrence
Jul 29 '13 at 19:53
It can be the source of many problems if you change something like this, actually. But this was just a guess.
– hytromo
Jul 29 '13 at 20:18
I had the same problem. Changing from kernel 4.9 to 4.4 solved it for me.
– Tom Hale
Jan 3 '17 at 21:31
add a comment |
I just did a fresh install of Ubuntu and now when I try to use sudo in the terminal emulator, it just hangs there without even asking me for a password.
If I switch to the terminal (Ctrl + Alt + F1) and login, sudo works as expected.
Can someone help me to figure this out?
sudo
I just did a fresh install of Ubuntu and now when I try to use sudo in the terminal emulator, it just hangs there without even asking me for a password.
If I switch to the terminal (Ctrl + Alt + F1) and login, sudo works as expected.
Can someone help me to figure this out?
sudo
sudo
asked Jul 29 '13 at 19:19
LawrenceLawrence
76113
76113
Just a thought, have you changed the character encoding of your terminal (Open Terminal, menu Terminal -> Set Character Encoding)
– hytromo
Jul 29 '13 at 19:21
No, I haven't, but I am curious as to why that would change anything.
– Lawrence
Jul 29 '13 at 19:53
It can be the source of many problems if you change something like this, actually. But this was just a guess.
– hytromo
Jul 29 '13 at 20:18
I had the same problem. Changing from kernel 4.9 to 4.4 solved it for me.
– Tom Hale
Jan 3 '17 at 21:31
add a comment |
Just a thought, have you changed the character encoding of your terminal (Open Terminal, menu Terminal -> Set Character Encoding)
– hytromo
Jul 29 '13 at 19:21
No, I haven't, but I am curious as to why that would change anything.
– Lawrence
Jul 29 '13 at 19:53
It can be the source of many problems if you change something like this, actually. But this was just a guess.
– hytromo
Jul 29 '13 at 20:18
I had the same problem. Changing from kernel 4.9 to 4.4 solved it for me.
– Tom Hale
Jan 3 '17 at 21:31
Just a thought, have you changed the character encoding of your terminal (Open Terminal, menu Terminal -> Set Character Encoding)
– hytromo
Jul 29 '13 at 19:21
Just a thought, have you changed the character encoding of your terminal (Open Terminal, menu Terminal -> Set Character Encoding)
– hytromo
Jul 29 '13 at 19:21
No, I haven't, but I am curious as to why that would change anything.
– Lawrence
Jul 29 '13 at 19:53
No, I haven't, but I am curious as to why that would change anything.
– Lawrence
Jul 29 '13 at 19:53
It can be the source of many problems if you change something like this, actually. But this was just a guess.
– hytromo
Jul 29 '13 at 20:18
It can be the source of many problems if you change something like this, actually. But this was just a guess.
– hytromo
Jul 29 '13 at 20:18
I had the same problem. Changing from kernel 4.9 to 4.4 solved it for me.
– Tom Hale
Jan 3 '17 at 21:31
I had the same problem. Changing from kernel 4.9 to 4.4 solved it for me.
– Tom Hale
Jan 3 '17 at 21:31
add a comment |
4 Answers
4
active
oldest
votes
Have you changed the hostname recently? I've noticed after a hostname change sudo can hang for a bit. However, if you update your hosts file to reflect the hostname change the hang will go away.
You can do that with this simple one-liner:
hostname | (echo -n "127.0.0.1 " && cat) | sudo tee -a /etc/hosts
1
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
1
Give this man a cookie! Thanks when changing theDevice Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.
– Flatron
Feb 1 '17 at 7:32
1
to fix it make sure to change/etc/hosts
also to your new hostname ;)
– Flatron
Feb 1 '17 at 7:32
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
add a comment |
If you want to check where it hangs, I suggest doing the executing the following command:
strace sudo
and then see what system call it is possibly hanging on. This might provide a good clue as to what is happening on your system.
My guess based on what you see is that hostname resolution is problematic on your system. Check out /etc/nsswitch.conf and /etc/resolv.conf files to make sure they are configured properly.
I have assummed that you have already checked your internet connectivity.
1
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
add a comment |
I am not sure which version of ubuntu you have installed, but there is a bug (race condition) in sudo, which hangs indefinitely blocking on a select.
https://bugzilla.sudo.ws/show_bug.cgi?id=447
add a comment |
I too had this problem with Ubuntu 16.04 . Using "top" command i found that two processes "vnstat" and "NetworkManager" are consuming 100% CPU. So i restarted the system, went to recovery mode and removed the package "vnstat" . After this restarted the system , now system works fine.
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%2f326194%2fsudo-hangs-without-prompting-for-password%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Have you changed the hostname recently? I've noticed after a hostname change sudo can hang for a bit. However, if you update your hosts file to reflect the hostname change the hang will go away.
You can do that with this simple one-liner:
hostname | (echo -n "127.0.0.1 " && cat) | sudo tee -a /etc/hosts
1
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
1
Give this man a cookie! Thanks when changing theDevice Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.
– Flatron
Feb 1 '17 at 7:32
1
to fix it make sure to change/etc/hosts
also to your new hostname ;)
– Flatron
Feb 1 '17 at 7:32
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
add a comment |
Have you changed the hostname recently? I've noticed after a hostname change sudo can hang for a bit. However, if you update your hosts file to reflect the hostname change the hang will go away.
You can do that with this simple one-liner:
hostname | (echo -n "127.0.0.1 " && cat) | sudo tee -a /etc/hosts
1
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
1
Give this man a cookie! Thanks when changing theDevice Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.
– Flatron
Feb 1 '17 at 7:32
1
to fix it make sure to change/etc/hosts
also to your new hostname ;)
– Flatron
Feb 1 '17 at 7:32
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
add a comment |
Have you changed the hostname recently? I've noticed after a hostname change sudo can hang for a bit. However, if you update your hosts file to reflect the hostname change the hang will go away.
You can do that with this simple one-liner:
hostname | (echo -n "127.0.0.1 " && cat) | sudo tee -a /etc/hosts
Have you changed the hostname recently? I've noticed after a hostname change sudo can hang for a bit. However, if you update your hosts file to reflect the hostname change the hang will go away.
You can do that with this simple one-liner:
hostname | (echo -n "127.0.0.1 " && cat) | sudo tee -a /etc/hosts
edited Jul 6 '18 at 20:07
K7AAY
3,89921644
3,89921644
answered Jul 29 '13 at 19:24
swiftimundoswiftimundo
18314
18314
1
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
1
Give this man a cookie! Thanks when changing theDevice Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.
– Flatron
Feb 1 '17 at 7:32
1
to fix it make sure to change/etc/hosts
also to your new hostname ;)
– Flatron
Feb 1 '17 at 7:32
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
add a comment |
1
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
1
Give this man a cookie! Thanks when changing theDevice Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.
– Flatron
Feb 1 '17 at 7:32
1
to fix it make sure to change/etc/hosts
also to your new hostname ;)
– Flatron
Feb 1 '17 at 7:32
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
1
1
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
It does not hang for 'a bit', it just hangs indefinitely. Also, it works on the terminal, just not in the terminal emulator.
– Lawrence
Jul 29 '13 at 19:54
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
This was the exact problem! Thank you!
– Nemanja Boric
Mar 24 '15 at 16:52
1
1
Give this man a cookie! Thanks when changing the
Device Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.– Flatron
Feb 1 '17 at 7:32
Give this man a cookie! Thanks when changing the
Device Name
in Ubuntu's system details utility you effectively break sudo. Great work @Canonical.– Flatron
Feb 1 '17 at 7:32
1
1
to fix it make sure to change
/etc/hosts
also to your new hostname ;)– Flatron
Feb 1 '17 at 7:32
to fix it make sure to change
/etc/hosts
also to your new hostname ;)– Flatron
Feb 1 '17 at 7:32
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
Great! I didn't actually notice that it timed out after ~30 sec and then continue with asking for sudo password. Another point: when you is about to change your hostname (maybe you cloned a VM) you might be disconnected to any network to avoid conflicts until you have change the entries. That's is properly also what's causing the timeouts
– Hulvej
Apr 23 '18 at 8:18
add a comment |
If you want to check where it hangs, I suggest doing the executing the following command:
strace sudo
and then see what system call it is possibly hanging on. This might provide a good clue as to what is happening on your system.
My guess based on what you see is that hostname resolution is problematic on your system. Check out /etc/nsswitch.conf and /etc/resolv.conf files to make sure they are configured properly.
I have assummed that you have already checked your internet connectivity.
1
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
add a comment |
If you want to check where it hangs, I suggest doing the executing the following command:
strace sudo
and then see what system call it is possibly hanging on. This might provide a good clue as to what is happening on your system.
My guess based on what you see is that hostname resolution is problematic on your system. Check out /etc/nsswitch.conf and /etc/resolv.conf files to make sure they are configured properly.
I have assummed that you have already checked your internet connectivity.
1
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
add a comment |
If you want to check where it hangs, I suggest doing the executing the following command:
strace sudo
and then see what system call it is possibly hanging on. This might provide a good clue as to what is happening on your system.
My guess based on what you see is that hostname resolution is problematic on your system. Check out /etc/nsswitch.conf and /etc/resolv.conf files to make sure they are configured properly.
I have assummed that you have already checked your internet connectivity.
If you want to check where it hangs, I suggest doing the executing the following command:
strace sudo
and then see what system call it is possibly hanging on. This might provide a good clue as to what is happening on your system.
My guess based on what you see is that hostname resolution is problematic on your system. Check out /etc/nsswitch.conf and /etc/resolv.conf files to make sure they are configured properly.
I have assummed that you have already checked your internet connectivity.
answered Jul 29 '13 at 21:05
mdpcmdpc
8361818
8361818
1
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
add a comment |
1
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
1
1
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
Why is internet connectivity required for sudo?
– grofte
Jun 17 '17 at 7:05
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
for FQDN information...as you can put host restrictions in your sudoers file.
– mdpc
Jun 20 '17 at 18:04
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
I did not understand that. I only know that it makes it tricky to reset the wifi adapter. Which is sometimes necessary after putting the laptop in sleep.
– grofte
Jun 25 '17 at 6:20
add a comment |
I am not sure which version of ubuntu you have installed, but there is a bug (race condition) in sudo, which hangs indefinitely blocking on a select.
https://bugzilla.sudo.ws/show_bug.cgi?id=447
add a comment |
I am not sure which version of ubuntu you have installed, but there is a bug (race condition) in sudo, which hangs indefinitely blocking on a select.
https://bugzilla.sudo.ws/show_bug.cgi?id=447
add a comment |
I am not sure which version of ubuntu you have installed, but there is a bug (race condition) in sudo, which hangs indefinitely blocking on a select.
https://bugzilla.sudo.ws/show_bug.cgi?id=447
I am not sure which version of ubuntu you have installed, but there is a bug (race condition) in sudo, which hangs indefinitely blocking on a select.
https://bugzilla.sudo.ws/show_bug.cgi?id=447
answered Nov 20 '16 at 20:24
sujan bolisettisujan bolisetti
111
111
add a comment |
add a comment |
I too had this problem with Ubuntu 16.04 . Using "top" command i found that two processes "vnstat" and "NetworkManager" are consuming 100% CPU. So i restarted the system, went to recovery mode and removed the package "vnstat" . After this restarted the system , now system works fine.
add a comment |
I too had this problem with Ubuntu 16.04 . Using "top" command i found that two processes "vnstat" and "NetworkManager" are consuming 100% CPU. So i restarted the system, went to recovery mode and removed the package "vnstat" . After this restarted the system , now system works fine.
add a comment |
I too had this problem with Ubuntu 16.04 . Using "top" command i found that two processes "vnstat" and "NetworkManager" are consuming 100% CPU. So i restarted the system, went to recovery mode and removed the package "vnstat" . After this restarted the system , now system works fine.
I too had this problem with Ubuntu 16.04 . Using "top" command i found that two processes "vnstat" and "NetworkManager" are consuming 100% CPU. So i restarted the system, went to recovery mode and removed the package "vnstat" . After this restarted the system , now system works fine.
answered Jan 5 at 1:39
manishmanish
133
133
add a comment |
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.
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%2f326194%2fsudo-hangs-without-prompting-for-password%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
Just a thought, have you changed the character encoding of your terminal (Open Terminal, menu Terminal -> Set Character Encoding)
– hytromo
Jul 29 '13 at 19:21
No, I haven't, but I am curious as to why that would change anything.
– Lawrence
Jul 29 '13 at 19:53
It can be the source of many problems if you change something like this, actually. But this was just a guess.
– hytromo
Jul 29 '13 at 20:18
I had the same problem. Changing from kernel 4.9 to 4.4 solved it for me.
– Tom Hale
Jan 3 '17 at 21:31