LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-25-2013, 08:08 AM   #1
dhuyvetter
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Rep: Reputation: Disabled
sudo: no pasword prompt, 3 incorrect password attempts


I was working via ssh on my web server when all of a suden I am unable to sudo. Whenever I try it just gives
Code:
Sorry, try again.
Sorry, try again.
Sorry, try again.
sudo: 3 incorrect password attempts
without giving the possibility to enter a password.

When I check groups for the user I'm using root is still in there:
Code:
groups dimi
dimi : dimi root cja
and I'm still in the sudoers:
Code:
dimi    ALL=(ALL) ALL
I can't login as root because back when I started using this server (a vps at my web hoster) I disabled it, but when I su I can give in the password:
Code:
su
Password: 
Cannot execute /dev/null: Permission denied
I can't check /var/log/auth.log, since I don't have the permissions to do so.

Any ideas what I could do?

I realize this is the same issue as http://www.linuxquestions.org/questi...tempts-912246/ but that one didn't get an answer, so I felt free to start a new one.
 
Old 01-25-2013, 09:53 AM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
> Cannot execute /dev/null: Permission denied

What is trying to execute /dev/null ? Has it been set as the shell in /etc/passwd ?

Do these sudo options help?
Quote:
-S

The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device. The password must be followed by a newline character.
-s [command]

The -s (shell) option runs the shell specified by the SHELL environment variable if it is set or the shell as specified in the password database. If a command is specified, it is passed to the shell for execution via the shell's -c option. If no command is specified, an interactive shell is executed.
 
1 members found this post helpful.
Old 01-25-2013, 09:59 AM   #3
dhuyvetter
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
using the -S option for sudo did the trick.
Thanks linosaurusroot!
 
Old 01-25-2013, 10:44 AM   #4
dhuyvetter
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by linosaurusroot View Post
What is trying to execute /dev/null ? Has it been set as the shell in /etc/passwd ?
Yep, set my /etc/passwd to:
Code:
root:x:0:0:root:/root:/dev/null
Did this because I'm using another account with root privileges and I read somewhere it's safer to disable the root account this way if you're not using it. But I guess it might be a good idea to keep it in case I need it.
 
Old 01-31-2013, 09:57 AM   #5
dhuyvetter
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
OK, not completely solved. Another user via ssh cannot sudo, sudo -s or sudo -S. All give the same error: 3 incorrect password attempts without a prompt for the password. I cannot find any answer to this anywhere on this forum of the internet. So any help would be extremely useful.
 
Old 01-31-2013, 03:19 PM   #6
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
If you have an alternate root account (bad idea IMO) why aren't you using "su - othername" ?
 
Old 01-31-2013, 03:29 PM   #7
dhuyvetter
LQ Newbie
 
Registered: Jan 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
It's a different user via ssh, this is for a webserver located at a hosting company and someone else needs to use it to. He's logging in with his account and then using su, which isn't really a good idea I guess, but the only thing that works for the moment. And when I sudo myself I have to use the -S option every time because otherwise I don't get prompted for a password. Still haven't figured out what happened to get this behavior or what I can do about it. A big pita.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo: no password prompt but 3 incorrect attempts? daweefolk Linux - Software 2 11-06-2011 09:45 PM
[SOLVED] Limit sudo access - No Password Prompt idny Linux - Security 6 02-18-2011 09:49 PM
Sudo Password Incorrect benjam1nrk Linux - Newbie 9 04-22-2010 07:11 AM
sudo without password prompt? ctroyp Linux - Newbie 7 09-12-2007 03:55 PM
Sudo authorizes me with incorrect password? jhermans Linux - Security 4 08-29-2004 09:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration