LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-26-2012, 09:58 AM   #1
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Rep: Reputation: 29
Run as su


When I try to run thunar as su I get the following error...

Code:
bash-4.1$ su
Password: 
bash-4.1# thunar
No protocol specified
No protocol specified
No protocol specified
No protocol specified
Thunar: Cannot open display: 
bash-4.1#

Being a poor typist, this is my preferred way to navigate to files for editing.
The computer is a Dell XPS l702x with dual video (integrated intel and discrete nvidia) running BumbleBee 3.0

I can enter
Code:
export XAUTHORITY=~/.Xauthority
as a user then su and it works. Is there a config file that can be edited so this can be skipped?

And I know running as root is not the best way to go about it, but, It's the way I like to do it...
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-26-2012, 10:27 AM   #2
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
Usually you have a tool comming with your wm... For kde it's "kdesu"... It launches a command as root, but setup display so it can use the "user space" xserver (it's a simplification).

You can use kdesu even with other wm comming with slackware, of course, if you've done a full install...

Code:
 bash-4.1$ kdesu thunar &>/dev/null &
(You can ommit the redirection and the background parts if you want some verbose/debug...)

EDIT: I haven't tried, but you might even be able to do something like:

Code:
 bash-4.1$ kdesu terminal &>/dev/null &
... and launch a 'root' terminal, being able to launch any graphical tool from root... WARNING: I haven't tested that, it needs to be confirmed.

Bests.

Last edited by NoStressHQ; 05-26-2012 at 10:30 AM. Reason: Added 'terminal' alternative...
 
Old 05-26-2012, 10:32 AM   #3
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 188Reputation: 188
You can just add a xhost line like the following:
Code:
xhost local:root &>/dev/null
in your ~/.bashrc to allow root opening X windows.
 
2 members found this post helpful.
Old 05-26-2012, 10:37 AM   #4
NoStressHQ
Member
 
Registered: Apr 2010
Location: Geneva - Switzerland ( Bordeaux - France / Montreal - QC - Canada)
Distribution: Slackware 14.2 - 32/64bit
Posts: 609

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by 414N View Post
You can just add a xhost line ...
Neat. Thanks.
 
Old 05-26-2012, 11:45 AM   #5
ceh383
Member
 
Registered: May 2003
Location: The Left coast, USA
Distribution: Slack_64 14.2
Posts: 226

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by 414N View Post
You can just add a xhost line like the following:
Code:
xhost local:root &>/dev/null
in your ~/.bashrc to allow root opening X windows.
That worked, thank you...
 
Old 05-26-2012, 04:05 PM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 5,938

Rep: Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916Reputation: 3916
Quote:
Originally Posted by 414N View Post
You can just add a xhost line like the following:
Code:
xhost local:root &>/dev/null
in your ~/.bashrc to allow root opening X windows.

Just a word of caution on this one. The "local:" family option on xhost ignores the username so the above would open the xserver up to any local user, not just root. If you're running a desktop machine it's probably not a big deal, but if you want to keep things tighter, you can use the following instead.
Code:
xhost +si:localuser:root
 
1 members found this post helpful.
Old 05-27-2012, 02:28 AM   #7
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 14.2, Slackwarearm-current
Posts: 1,056

Rep: Reputation: 163Reputation: 163
Did you try
Code:
su -
instead of "su"?
 
Old 05-27-2012, 03:10 AM   #8
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 188Reputation: 188
Quote:
Originally Posted by GazL View Post
Just a word of caution on this one. The "local:" family option on xhost ignores the username so the above would open the xserver up to any local user, not just root. If you're running a desktop machine it's probably not a big deal, but if you want to keep things tighter, you can use the following instead.
Code:
xhost +si:localuser:root
Thanks for the advice!
 
  


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
I want a small linux to run on AMD Duron that can run usb internet receiver emusthroat Linux - Newbie 3 04-05-2012 03:35 PM
how to run linux command from a different user from a jsp page which is run by tomcat etika Linux - Newbie 2 04-27-2011 11:53 AM
How to enter graphical mode (run level 5) command line (run lenel 3) edmondgyampoh Linux - Newbie 3 05-15-2009 06:33 PM
trying to fix xwindows or just run command line... changing run levels dave247 Debian 2 11-18-2008 06:11 PM
Is a script, run at boot time from init.d, run with root authority? tmbrwolf53 Linux - Server 2 03-31-2007 08:15 PM

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

All times are GMT -5. The time now is 03:21 AM.

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