LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-06-2007, 10:23 PM   #1
MikeOfAustin
Member
 
Registered: Apr 2007
Location: texas
Distribution: mandriva 2007.0 / edgy
Posts: 63

Rep: Reputation: 15
Giving user 'www-data' same permissions as normal user


I'm trying to run applications remotely through the web (apache). For example, to make the remote system start mplayer.

If I try locally to run mplayer as me, it works, but If I try

sudo su www-data

then

Mplayer <file name>

It won't work. 'Xlib: client is not authorized to connect to server'.

I can't run allot of applications because it appears to be a permission thing.
 
Old 06-07-2007, 03:37 AM   #2
MikeOfAustin
Member
 
Registered: Apr 2007
Location: texas
Distribution: mandriva 2007.0 / edgy
Posts: 63

Original Poster
Rep: Reputation: 15
More info:
So I've found that to start a windowed ap like mplayer or totem, you have to use "xhost +" command, as whom-ever currently owns the display. that's not such a big deal anymore and I'm really not caring about running a windowed application... however, I am still needing to run commands (I was just using mplayer as a test application to run).

so... if I sudo su www-data and issue a simple 'rm *.jpg', I get operation not permitted.

I've changed /etc/group so www-data is in all groups (except admin, etc) that my user is in. Still no go. Is it a 'nobody' thing???

Any (any) idea's at all will be helpful.

Last edited by MikeOfAustin; 06-07-2007 at 03:47 AM.
 
Old 06-07-2007, 03:37 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,439

Rep: Reputation: 103Reputation: 103
probably youshouldnt switch to root as root may not connect to the X server as the message says.

for the rm command (that is probably excuted in php?) Resides the file in the documentRoot? May be the crucial spot...

Last edited by j-ray; 06-07-2007 at 03:46 AM.
 
Old 06-07-2007, 07:41 AM   #4
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Quote:
Originally Posted by MikeOfAustin
so... if I sudo su www-data and issue a simple 'rm *.jpg', I get operation not permitted.
What are the permissions of the directory in which you are executing this command? Try
Code:
ls -ld .
Have you considered running the webserver as the desired user, instead of www-data?

Groetjes,

Kees-Jan
 
Old 06-07-2007, 02:03 PM   #5
MikeOfAustin
Member
 
Registered: Apr 2007
Location: texas
Distribution: mandriva 2007.0 / edgy
Posts: 63

Original Poster
Rep: Reputation: 15
Running apache as a 'real' user fixed it. Thanks.

Now, I'm off to try and figure out why I can't get totem or mplayer to start on the remote system... not for any real application, just that I can't do it is all.
 
Old 06-08-2007, 03:50 AM   #6
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Totem and realplayer want to connect to the graphics screen. It has its own security system. Try looking into "xauth".

Then again, running apache as the user who is logged in should fix that too.

Groetjes,

Kees-Jan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NFS www-data user errors blu_alchemist Linux - Server 2 06-06-2007 05:26 PM
add www-data user restless Linux - Newbie 1 06-01-2004 08:51 AM
user permissions giving me annoyances hypermegachi Slackware 3 11-01-2003 03:48 PM
Giving a user CHMOD rights to the /var/www/html directory? scubes13 Linux - Networking 3 08-18-2002 04:38 PM
Giving a user all root permissions ranixlb Linux - Security 9 05-15-2002 01:50 PM


All times are GMT -5. The time now is 10:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration