Re: running script via root permission again!!
| From: | Web Admin | Date: | Tue, 29 Aug 2000 16:35:49 +0000 |
| Subject: | Re: running script via root permission again!! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-14173@lists.php.net to get a copy of this message | ||
Marko,
this is becuase you have changed the permission of your
messages file, the standard one [and mine is the same]:
[root@yashm conf]# ls -l /var/log/messages
-r-x------ 1 root root 110408 Aug 29 20:28 /var/log/messages
i want to read this file, what should i do?
Thanks for your attention,
Ahmad
----- Original Message -----
From: "Marko Vukovic'" <vukko@cequrux.com>
To: "Web Admin" <webadmin@morva.net>
Cc: <php-general@lists.php.net>
Sent: Tuesday, August 29, 2000 9:03 PM
Subject: Re: [PHP] running script via root permission again!!
> Web Admin wrote:
> >
> > hey gurus,
> > i finally couldn't find a suitable way for running my php scripts
> > to read and show /var/log/messages in the browser. does
> > anyone know how to do that?
> > - i changed the file mode to 4755 and chown root.root (X) didnt work
> > - tried to change the httpd process owner from nobody to root,
> > it can't be changed unless it recompiled and unsecure (X)
> > - i dont want to chmod 777 /var/log/messages
> >
> > can anyone help please?!! you think using sudo is a good solution?
> > if yes, could anyone please describe if i have to run httpd using sudo
> > or give tail access of /var/log/messages to nobody?
> >
> > ---------------------
> > 2nd question, i'm writing admin tools for a company to add users and
> > change user passwords, etc.. i decided not to write in php3 and write
> > in perl. how can I run perl scripts with root privileges? does chmod
> > work? i tried 4755 but it can't still print
tail
> > /var/log/messages
which
> > is owned by root.
> >
> > This is urgent, please help ASAP!!
> > Ahmad Anvari
> > Website Admin.
> > Morva Network
>
> Hi Ahmad,
>
> This works for me:
>
> <?
>
> echo "<hmtl>\n<body bgcolor=\"#FFFFFF\">\n<pre>\n";
> echo tail /var/log/messages;
>
> ?>
>
> here's the perms:
>
> -rw-rw-r-- 1 root wheel 74442 Aug 29 17:31 /var/log/messages
>
> my httpd appears to be running as 'nobody'
>
> --
> Marko.
>