Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I haven't edited my sudoers, but I don't have to enter the password when running a sudo command line in the terminal. I can run any sudo command without entering the password, how can I stop this ?

share|improve this question
5  
Is your user account secured with a password? –  Davidson Chua Apr 20 at 2:44
4  
Also, if you entered a password a while ago, it caches for some time. –  Thomas W. Apr 20 at 2:50
    
Which groups are you in? Use /usr/bin/id and read man sudoers. You are not root already, are you? –  waltinator Apr 20 at 3:36
    
Yes my user account is password secured. Even after several reboots the problem remains. Can any of you give me a work around to find whether I have accidentally edited my sudoers. –  ktcool Apr 20 at 3:42
    
@waltinator This is what I got "uid=1000(ktcool) gid=1000(ktcool) groups=1000(ktcool),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),108(lpadmin),1‌​24(sambashare)" after running ' /usr/bin/id ' –  ktcool Apr 20 at 3:57

2 Answers 2

Use visudo to edit your sudoers file and look for NOPASSWD: - that's the directive disabling the user password prompt (you NEVER have to enter the password of the target user, i.e. the root password). Simply removing that directive (including the colon at the end) should require you to re-enter your password to use sudo (unless you used it recently, then it's still cached, you can clear this using sudo -k)

share|improve this answer

sudo -i is the way to go if you don't want to be typing a password every now and then while doing modifications in your system (or other systems), and you don't want to modify any system files. It will switch you to root using your sudo user password, when you close the console or type exit you are back to your normal user. hopes this qorks , regards:)

share|improve this answer
1  
The problem is that he wants to type a password but his system isn't prompting for one, instead it accepts and executes his commands as if he has typed one. –  hmayag Jun 16 at 8:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.