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

RE: su : must be run from a terminal

There are two other standard ways to have scripts run with root privileges.

1) For automated tasks, schedule it in root's crontab.  'man crontab' for
more info

2) Use setuid for scripts or programs that are to be run by users who need
root perms to perform a specific task programmed into that script.  You need
to think about security on this one though.  See 'man setuid' and 'man
chmod' for more info.


-----Original Message-----
From: Martin Fluch [mailto:fluch@rock.it.helsinki.fi]
Sent: Wednesday, November 03, 2004 1:39 AM
To: debian-user@lists.debian.org
Subject: Re: su : must be run from a terminal


>From what it looks to me you should consider using sudo for your task. 
There you can allow in a very detailed way certain commands to 
be executed 
without giving a password. Hardcoding the root password into a 
script as 
you try seems to me very risky...

- Martin

On Wed, 3 Nov 2004, STEPHANE DURIEUX wrote:

> Hi,
> I have made a short script with the su command within
> I have tried : echo -ne "password\n"|su - root
> But it gives me the following message.
> su : must be run from a terminal
> Have you any idea
> Thanks
>         Stephane Durieux
> Vous manquez d'espace pour stocker vos mails ?
> Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
> Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les 
nouveautés pour dialoguer instantanément avec vos amis. A 
télécharger gratuitement sur http://fr.messenger.yahoo.com

Reply to: