sudo: no tty present and no askpass program specified | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

sudo: no tty present and no askpass program specified

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 02-21-2010
linuxgeek linuxgeek is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 10 May 2012, 10:18 PM EDT
Posts: 78
Thanks: 13
Thanked 0 Times in 0 Posts
sudo: no tty present and no askpass program specified

Hi Gurus:

Can you help me get out of this message ?

I already commented out the ff line in /etc/sudoers file but still prompts me for this message.


Code:
#Defaults requiretty

-sh-3.2$ ./check_diskErrors itag3.pm.staging.intra /dev/sda
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified
sudo: no tty present and no askpass program specified

I'm using FC 11 for the client and FC8 for the source connecting to client.

Any idea on this ?

Last edited by pludi; 02-22-2010 at 01:52 AM.. Reason: code tags, please...
Sponsored Links
    #2  
Old 02-22-2010
pludi's Avatar
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,522
Thanks: 38
Thanked 335 Times in 308 Posts
sudo will only run a program as a different user if one of these 3 conditions has been met (as far as passwords are concerned):
  1. the NOPASSWD option is specified
  2. the user entered the correct target password
  3. the user entered the correct source password
Since options 2 and 3 require a TTY (sudo won't read from a pipe) it won't run if it can't find one. Check your script if at any point you're running a script remotely using ssh, as it's possible that it won't allocate a TTY for a non-interactive remote command.
Sponsored Links
    #3  
Old 03-15-2010
linuxgeek linuxgeek is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 10 May 2012, 10:18 PM EDT
Posts: 78
Thanks: 13
Thanked 0 Times in 0 Posts
hi pludi,

Yes, im running ssh remotely on my script and I specify the NOPASSWD command


Code:
nagios ALL=NOPASSWD: /usr/sbin/smartctl

I can login automatically to my destination server using nagios. The problem is it won't allocate a TTY for a non-interactive remote command.

Last edited by linuxgeek; 03-15-2010 at 03:52 AM..
    #4  
Old 03-15-2010
binlib binlib is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 15 March 2013, 10:40 AM EDT
Location: New Jersey
Posts: 380
Thanks: 7
Thanked 90 Times in 75 Posts

Code:
 ssh -t

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Unable to use the Sudo command. "0509-130 Symbol resolution failed for sudo because:" Chloe123 UNIX for Dummies Questions & Answers 1 12-21-2009 04:09 PM
How to remove sudo program unitipon Solaris 1 11-16-2007 02:29 AM
Check whether the pattern is present or not? skyineyes Shell Programming and Scripting 8 06-27-2007 09:42 AM



All times are GMT -4. The time now is 05:41 AM.