Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 02-19-2013, 09:29 AM   #1
mariouka
Registered User
 
Join Date: Feb 2013
Posts: 1
sudo suddenly won't accept my passowrd

Hi,
I'm on macbook os x 10.5.8
Short story: the sudo command won't take my password.
The way it happened:
I wanted to change a file name, so I typed "sudo mv /pathtofile/file newfile". As I was typing my password, I realized that I had mistyped the destination file name, so I pressed enter before finishing to type my password thinking that that would allow me to fix my command and re-enter my password. The next time I tried doing sudo mv etc... I got "Sorry, try again", and then "3 failed attempts" or something of the sort. Apparently, my blunder has caused me to not be part of sudoers anymore. I don't know how to fix that.
Thanks
Marion
mariouka is offline   Reply With Quote
Old 02-19-2013, 11:45 AM   #2
fracai
MVP
 
Join Date: May 2004
Posts: 2,012
First, try opening a new Terminal window and try sudo there. You can also try logging out or rebooting.
Second, if that doesn't work, paste the contents of /etc/sudoers
Third, if your name (or group, are you an admin user?) isn't listed there, you'll likely need to boot into Single User Mode and make the correction there.
Finally, in the future you cancel your current command using "Control c". Though, I doubt that's what caused the problem.
__________________
i am jack's amusing sig file
fracai is offline   Reply With Quote
Old 02-19-2013, 12:14 PM   #3
trevor
Moderator
 
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,560
Quote:
Originally Posted by fracai
Second, if that doesn't work, paste the contents of /etc/sudoers

At least on my computer, /etc/sudoers has permissions -r--r----- with ownership by root/wheel.

In other words, unless you are root or are a member of wheel, you need sudo to be able to read sudoers. (If you have a password set for root, you could of course su to root and see it from there. But it's not a good idea for your computer's security to have a password set for root.)

It's probably not as satisfying but I would hope nearly as convincing, to just look at the date that /etc/sudoers was last modified to see if it was somehow messed up. I also doubt that /etc/sudoers is what is causing the problem, but try

ls -TOel /etc/sudoers

If the date it was last modified was recently, then you may be on to something. I suspect that the date /etc/sudoers was last modified was quite some time ago, so you have not recently affected it in any way.

By the way, an alternate way to see the contents of /etc/sudoers without having the ability to use sudo is to boot to single user mode, as fracai alluded. That puts you into an environment with root privileges, so you will be able to read the file.

Trevor
trevor is offline   Reply With Quote
Old 02-19-2013, 12:24 PM   #4
hayne
Site Admin
 
Join Date: Jan 2002
Location: Montreal
Posts: 31,956
Quote:
Originally Posted by mariouka
Apparently, my blunder has caused me to not be part of sudoers anymore. I don't know how to fix that.

Did 'sudo' work sometime recently before the command that you refer to as a "blunder"?
It seems unlikely that that command was the cause for your current situation.
__________________
hayne.net/macosx.html
hayne is online now   Reply With Quote
Old 02-20-2013, 06:07 PM   #5
ganbustein
MVP
 
Join Date: Apr 2008
Location: Berkeley CA USA
Posts: 1,016
I've never seen the need to modify /etc/sudoers.

If I'm logged in as my non-admin user (the usual case) and want to do some admin work (using sudo, for example) and don't want to use Fast User Switching or similar to get an admin GUI environment (big hassle, especially since I can't copy/paste nor even view windows between the environments), what I do is:

su -l boss
boss' password
sudo ...
boss' password
... other stuff needing admin privilege ...
logout

where boss is the name of my admin user. That is, with no change to /etc/sudoers, I can still use sudo freely, the only cost being (a) I have to know an admin user's password, and (b) I have to type it twice. I think that's reasonable.


Back to your original problem: You could create a new admin user, and use that user to fix whatever problem you're having. To create a new user, you need an admin's password, which you should have if you've been entrusted with sudo privileges.

If you don't know an admin's password, talk to whomever does. They're the one who should be helping you with this, not us.

Something you might try in the meantime: I doubt that /etc/sudoers has been modified. More likely, some sort of timeout was imposed. That timeout has surely expired by now. If it hasn't, you could try sudo -K to kill it. (That won't require a password.) Not sure if that will work, since the timestamp it kills measures when you need to enter your password again, not when you may enter it again, but it can't hurt to try.
ganbustein is offline   Reply With Quote
Reply

Tags
password failure, sudo

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:57 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.