FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 02-25-2010, 06:35 PM
Josef Wolf
 
Default sudo: no tty present and no askpass program specified

Hello,

On karmic, I have put the following line into my sudoers file

naclt ALL = NOPASSWD: /usr/local/bin/naclient

to allow execution of this program as root from remote hosts. So from the
remote host, I do

/usr/bin/ssh -i /home/me/.ssh/naclt-dsa
-o "ServerAliveInterval 60"
-o "ServerAliveCountMax 3"
naclt@server.my.domain
/usr/bin/sudo /usr/local/bin/naclient version

But sudo errors out:

sudo: no tty present and no askpass program specified

Why is sudo trying to ask a password here? Did it not get the NOPASSWD
option?

This works perfectly fine with jaunty with exactly the same sudoers file.

Any ideas?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-25-2010, 06:58 PM
Tom H
 
Default sudo: no tty present and no askpass program specified

> On karmic, I have put the following line into my sudoers file
>
> *naclt ALL = NOPASSWD: /usr/local/bin/naclient
>
> to allow execution of this program as root from remote hosts. So from the
> remote host, I do
>
> */usr/bin/ssh -i /home/me/.ssh/naclt-dsa
> * * * * * * *-o "ServerAliveInterval 60"
> * * * * * * *-o "ServerAliveCountMax 3"
> * * * * * * *naclt@server.my.domain
> * * * * * * */usr/bin/sudo /usr/local/bin/naclient version
>
> But sudo errors out:
>
> *sudo: no tty present and no askpass program specified
>
> Why is sudo trying to ask a password here? Did it not get the NOPASSWD
> option?
>
> This works perfectly fine with jaunty with exactly the same sudoers file.

http://www.sudo.ws/pipermail/sudo-users/2009-August/004140.html

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-25-2010, 07:12 PM
Josef Wolf
 
Default sudo: no tty present and no askpass program specified

On Thu, Feb 25, 2010 at 02:58:13PM -0500, Tom H wrote:
> > On karmic, I have put the following line into my sudoers file
> >
> > *naclt ALL = NOPASSWD: /usr/local/bin/naclient
> >
> > to allow execution of this program as root from remote hosts. So from the
> > remote host, I do
> >
> > */usr/bin/ssh -i /home/me/.ssh/naclt-dsa
> > * * * * * * *-o "ServerAliveInterval 60"
> > * * * * * * *-o "ServerAliveCountMax 3"
> > * * * * * * *naclt@server.my.domain
> > * * * * * * */usr/bin/sudo /usr/local/bin/naclient version
> >
> > But sudo errors out:
> >
> > *sudo: no tty present and no askpass program specified
> >
> > Why is sudo trying to ask a password here? Did it not get the NOPASSWD
> > option?
> >
> > This works perfectly fine with jaunty with exactly the same sudoers file.
>
> http://www.sudo.ws/pipermail/sudo-users/2009-August/004140.html

Thanks for the fast response, Tom!

I understand that sudo refuses to ask for a password if there's no tty.
But I have explicitly told it _not_ to ask with the NOPASSWD option. So
there's no reason for sudo to refuse, since it should not try to ask in
the first place.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-25-2010, 11:15 PM
Brian McKee
 
Default sudo: no tty present and no askpass program specified

On Thu, Feb 25, 2010 at 3:12 PM, Josef Wolf <jw@raven.inka.de> wrote:
> On Thu, Feb 25, 2010 at 02:58:13PM -0500, Tom H wrote:
>> > On karmic, I have put the following line into my sudoers file
>> >
>> > *naclt ALL = NOPASSWD: /usr/local/bin/naclient
>> >
>> > to allow execution of this program as root from remote hosts. So from the
>> > remote host, I do
>> >
>> > */usr/bin/ssh -i /home/me/.ssh/naclt-dsa
>> > * * * * * * *-o "ServerAliveInterval 60"
>> > * * * * * * *-o "ServerAliveCountMax 3"
>> > * * * * * * *naclt@server.my.domain
>> > * * * * * * */usr/bin/sudo /usr/local/bin/naclient version
>> >
>> > But sudo errors out:
>> >
>> > *sudo: no tty present and no askpass program specified
>> >
>> > Why is sudo trying to ask a password here? Did it not get the NOPASSWD
>> > option?
>> >
>> > This works perfectly fine with jaunty with exactly the same sudoers file.
>>
>> http://www.sudo.ws/pipermail/sudo-users/2009-August/004140.html
>
> Thanks for the fast response, Tom!
>
> I understand that sudo refuses to ask for a password if there's no tty.
> But I have explicitly told it _not_ to ask with the NOPASSWD option. So
> there's no reason for sudo to refuse, since it should not try to ask in
> the first place.
>

does adding the -t option make it work ?

Brian
--
Hey, it's your computer.... isn't it?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-26-2010, 02:37 AM
Tom H
 
Default sudo: no tty present and no askpass program specified

>> > Why is sudo trying to ask a password here? Did it not get the NOPASSWD
>> > option?

>> > This works perfectly fine with jaunty with exactly the same sudoers file.

>> http://www.sudo.ws/pipermail/sudo-users/2009-August/004140.html

> Thanks for the fast response, Tom!

> I understand that sudo refuses to ask for a password if there's no tty.
> But I have explicitly told it _not_ to ask with the NOPASSWD option. So
> there's no reason for sudo to refuse, since it should not try to ask in
> the first place.

You're welcome.

The point of the link was that if you add
Defaults visiblepw
to
/etc/sudoers
"You can restore the old behavior"

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-26-2010, 02:52 PM
Josef Wolf
 
Default sudo: no tty present and no askpass program specified

On Thu, Feb 25, 2010 at 10:37:30PM -0500, Tom H wrote:

> >> > Why is sudo trying to ask a password here? Did it not get the NOPASSWD
> >> > option?

> >> http://www.sudo.ws/pipermail/sudo-users/2009-August/004140.html

> > I understand that sudo refuses to ask for a password if there's no tty.
> > But I have explicitly told it _not_ to ask with the NOPASSWD option. So
> > there's no reason for sudo to refuse, since it should not try to ask in
> > the first place.
>
> You're welcome.
>
> The point of the link was that if you add
> Defaults visiblepw
> to
> /etc/sudoers
> "You can restore the old behavior"

Ah, I see now what you mean.

Strange enough, it works now, without any changes. No idea what the problem
could have been.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 02-26-2010, 04:52 PM
Tom H
 
Default sudo: no tty present and no askpass program specified

>>>> http://www.sudo.ws/pipermail/sudo-users/2009-August/004140.html

>> The point of the link was that if you add
>> Defaults visiblepw
>> to
>> /etc/sudoers
>> "You can restore the old behavior"

> Ah, I see now what you mean.
> Strange enough, it works now, without any changes. No idea what the
> problem could have been.

If the problem comes back, this is from the sudoers man page:

visiblepw By default, sudo will refuse to run if the user must
enter a password but it is not possible to disable echo
on the terminal. If the visiblepw flag is set, sudo
will prompt for a password even when it would be
visible on the screen. This makes it possible to run
things like "rsh somehost sudo ls" since rsh(1) does
not allocate a tty. This flag is off by default.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:13 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org