LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-15-2007, 08:21 AM   #1
gbowden
Member
 
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148

Rep: Reputation: 28
Running X programs as root.


Is there anything wrong with doing the following to run X programs as root:

xauth -f /home/[user]/.Xauthority extract - :0 | xauth merge -
export DISPLAY=:0

Regards,

Greg
 
Old 03-15-2007, 09:47 AM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
It seems like a lot of extra work. Have you tried simply:
Code:
$ su -m
# ./x-app-here
?
 
Old 03-15-2007, 10:05 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104
Quote:
Originally Posted by anomie
It seems like a lot of extra work. Have you tried simply:
Code:
$ su -m
# ./x-app-here
?
That does not work in Slackware.
What I usually do to get X apps to run on my display after su-ing to root:
Code:
echo $DISPLAY                  # you'll be needing this value 3 lines below
sudo -i                        # or "su -" on older Slackwares
xauth merge ~alien/.Xauthority # use your own username here instead of "alien"
export DISPLAY=:0.0            # use the value of DISPLAY you've seen 3 lines before
Eric
 
Old 03-15-2007, 10:07 AM   #4
gbowden
Member
 
Registered: Dec 2003
Location: Spain
Distribution: Slackware 14.1 64bit - multilib
Posts: 148

Original Poster
Rep: Reputation: 28
Thanks for your help everyone.

Last edited by gbowden; 03-15-2007 at 10:09 AM.
 
Old 03-16-2007, 10:12 AM   #5
SpelledJ
Member
 
Registered: Jun 2006
Location: Birmingham, AL
Distribution: Slackware64-13.1, 12.1
Posts: 119

Rep: Reputation: 20
Eric -
Can you give a quick explanation (or link to some info) of what's different about Slackware's X configuration that prevents anomie's suggestion from working? It seems like I've been able to just su to root and run an X program on other distros, but not Slack.
 
Old 03-16-2007, 10:44 AM   #6
General Maximus
LQ Newbie
 
Registered: Mar 2007
Distribution: Slackware 11, BOSS Linux
Posts: 2

Rep: Reputation: 0
Erm, what about kdesu (or gksu in GNOME)?
 
Old 03-16-2007, 11:26 AM   #7
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104Reputation: 8104
Quote:
Originally Posted by SpelledJ
Eric -
Can you give a quick explanation (or link to some info) of what's different about Slackware's X configuration that prevents anomie's suggestion from working? It seems like I've been able to just su to root and run an X program on other distros, but not Slack.
This is because Slackware uses the "su" program that is part of the "shadow" utilities. Other distros probably are using the "su" that comes with the coreutils package, and which knows about the "-m" option.

Eric
 
Old 03-16-2007, 02:02 PM   #8
SpelledJ
Member
 
Registered: Jun 2006
Location: Birmingham, AL
Distribution: Slackware64-13.1, 12.1
Posts: 119

Rep: Reputation: 20
I never realized there were any differences in the low-level utilities. I assumed they were all GNU-based, and every distro used the same ones. I looked up the man page for the coreutils 'su', and sure enough, its -m flag prevents the environment variables from being reset when you change users. The manpage for 'su' on my Slackware box doesn't include that flag. I also didn't know that the same package (shadow) provides all of the useradd/groupadd/etc scripts. Thanks for the info, Eric.

Justin
 
  


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
Running of root-insistenet programs Tinku Linux - General 3 04-09-2005 04:28 AM
running programs from root oscarp Linux - Software 2 09-17-2004 08:08 AM
running programs as root marsques Linux - Newbie 5 08-15-2004 01:18 PM
running programs as root mehesque Linux - General 16 06-09-2004 04:18 PM
Fluxbox and Running Programs as Root jrdioko Linux - Newbie 5 06-14-2003 07:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration