[CentOS] Cronjob and sudo

Thu Feb 12 18:37:52 UTC 2015
Eero Volotinen <eero.volotinen at iki.fi>

You can disable requiretty for one user also:
https://linuxreference.wordpress.com/2010/11/22/disable-requiretty-in-etcsudoers/

--
Eero

2015-02-12 20:32 GMT+02:00 Matt <matt.mailinglists at gmail.com>:

> I need to remove empty files out of a directory that are over 6 hours
> old so I created this script and put it in cron.hourly.
>
> #!/bin/sh
> cd /var/list
> sudo -u matt find /var/list -mmin +360 -empty -user matt -exec rm {} \;
>
> I want to run it as matt rather than root for just an added bit of
> safety.  Problem is I get this.
>
> "sudo: sorry, you must have a tty to run sudo"
>
> Is there another way to do this?  As I understand the reason for this
> is requiretty in sudo config.  If that improves security I would
> rather not change that setting.
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>