linux sudo: no tty present and no askpass program specified | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

linux sudo: no tty present and no askpass program specified

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-15-2012
jeff-fafa jeff-fafa is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 20 August 2012, 3:24 AM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
linux sudo: no tty present and no askpass program specified

Hi

I have an Oracle DBA that is trying to install an RPM from Stratavia which is a web based portal and it executes the following:


Code:
Instance Wrapper=sudo -u oracle /opt/datapalette/jython/jython
Server Wrapper=sudo -u root /opt/datapalette/jython/jython

I've compared the /etc/sudoers file with another sudoers of a server where this was done successfully, but both file are identical wrt the oracle user


Code:
oracle ALL = NOPASSWD: DBSPI,NOPASSWD:NIMBUS
oracle ALL = NOPASSWD: DBSPI,NOPASSWD:NIMBUS,NOPASSWD:ORA10204
datapal ALL = (oracle) NOPASSWD: ALL


Please can someone help, not sure what I'm missing here??

Thanks


Moderator's Comments:
Please use code tags next time for your code and data.

Last edited by zaxxon; 08-15-2012 at 04:38 AM.. Reason: code tags
Sponsored Links
    #2  
Old 08-15-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 17 September 2014, 8:30 AM EDT
Location: Switzerland - GE
Posts: 5,710
Thanks: 156
Thanked 400 Times in 375 Posts
What is the actual error message? (not your interpretation...)
Sponsored Links
    #3  
Old 08-15-2012
jeff-fafa jeff-fafa is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 20 August 2012, 3:24 AM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry, the title is the error code:


Code:
linux sudo: no tty present and no askpass program specified


Last edited by zaxxon; 08-15-2012 at 05:02 AM.. Reason: code tags
    #4  
Old 08-15-2012
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
 
Join Date: Sep 2005
Last Activity: 17 September 2014, 8:30 AM EDT
Location: Switzerland - GE
Posts: 5,710
Thanks: 156
Thanked 400 Times in 375 Posts
The syntax of your sudoers does not look right to me but I may be wrong (on linux under the hand to check...) how did you edit to compare? try to use visudo to see if it complains...
Sponsored Links
    #5  
Old 08-15-2012
jeff-fafa jeff-fafa is offline
Registered User
 
Join Date: Aug 2012
Last Activity: 20 August 2012, 3:24 AM EDT
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Sorry the detail wasn't correct, it looks exactly like below:


Code:
oracle          ALL             = NOPASSWD:DBSPI,NOPASSWD:NIMBUS
oracle          ALL             = NOPASSWD:DBSPI,NOPASSWD:NIMBUS,NOPASSWD:ORA10204
datapal ALL             = (oracle) NOPASSWD: ALL

Thanks
Sponsored Links
    #6  
Old 08-15-2012
raggmopp raggmopp is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 6 December 2012, 11:08 PM EST
Posts: 26
Thanks: 5
Thanked 2 Times in 2 Posts
Here is an answer I submitted yesterday. This is a cut&paste of that answer.
The application is different but the functions of what you are looking for are the same.
HIH


For the 'no tty present', open up your sudoers file and look for a line that says
Quote:
Defaults requiretty
Change it so the requiretty has the negate character in front. Make it look like
Quote:
Defaults !requiretty
Notice the exclamation (negate) character in front of the requiretty

I'm confused by the code you are using
ssh musedeploy@${SERVER} ${PSWD} || die "Deployment failed"That looks like you are just trying to login to $SERVER as the user musedeploy and the failure is on the passwd. Does this account execute something on login?

Your sudo entry, is that on the $SERVER or is that on the local system? If you are wanting to execute the command on $SERVER then put the entry into the sudoers on $SERVER. You may want to setup passwd-less login for ssh as well.

With the !requiretty and the sudoers entry on $SERVER you could try your command as such:


Code:
 ssh musedeploy@${SERVER} 'sudo $MUSE_CMD'

As you have NOPASSWD in the sudoers there is no need to worry about that.

The MUSE_CMD sudoers entry, is that suppose to be a single command or are they a string of separate commands? It appears you have multiple individual commands, they are not executing in succession. Is that what you are trying for?
Sponsored Links
    #7  
Old 08-15-2012
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 16 September 2014, 5:59 PM EDT
Location: Saskatchewan
Posts: 19,361
Thanks: 787
Thanked 3,256 Times in 3,052 Posts
You could also give it a tty with ssh -t, but 'no tty' usually means sudo wants to ask for a password and can't. Depriving it of even more means to ask for a password isn't going to actually let it in...

Last edited by Corona688; 08-15-2012 at 12:02 PM..
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
sudo: no tty present and no askpass program specified chidori Red Hat 4 08-16-2012 11:32 AM
Error - sudo: no tty present and no askpass program specified steadyonabix UNIX for Advanced & Expert Users 2 08-15-2012 01:18 PM
how to execute a program present on another server using SFTP in perl anandgodse Shell Programming and Scripting 1 07-18-2012 02:15 AM
sudo: no tty present and no askpass program specified linuxgeek Red Hat 3 03-15-2010 04:58 PM
How to remove sudo program unitipon Solaris 1 11-16-2007 02:29 AM



All times are GMT -4. The time now is 09:33 AM.