Re: Sudo from scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jerry Feldman wrote:
> Over the years I have used sudo from some of my scripts (RHEL 3 and
> 4,  SuSE (5-11), but I found in Fedora 9 (and CentOS 5.2) that sudo
> will fail:
>
> sudo: sorry, you must have a tty to run sudo
>
> In this particular case it was run on a CentOS 5.2 system, but I had
> the same issue with Fedora 9. In both cases the user account was set
> to NOPASSWD. Actually, on my home system it was my nightly backup
> script I run from my crontab. 
>
> There are certainly some easy workarounds, such as running these
> scripts from root's cron (cron.daily, cron.weekly, ...), or writing
> my own sudo command (which I've done before Sudo arrived). 
>
> Is there now a setting where I can run sudo non-interactively, or is
> this a new security restriction. 

It is, as mentioned in /etc/sudoers:

#
# Disable "ssh hostname sudo <cmd>", because it will show the password
# in clear.
#         You have to run "ssh -t hostname sudo <cmd>".
#
Defaults    requiretty

I don't know if there's a good way to run things via cron and convince
sudo that you have a tty.  If not, you might just comment out the
requiretty setting.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Moral indignation is jealousy with a halo.
    -- H. G. Wells

Attachment: pgppYtU07q63u.pgp
Description: PGP signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux