The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Finding The Number Of Programs That A Given User Running On A TERMINAL venkata.ganesh Shell Programming and Scripting 4 05-22-2007 06:23 AM
installing/running programs. shep UNIX for Dummies Questions & Answers 4 12-06-2005 10:35 PM
Running out of Space (Root) scorpiyanz UNIX for Advanced & Expert Users 0 08-19-2005 10:22 AM
running preinstalled programs jestra UNIX for Dummies Questions & Answers 2 02-13-2004 05:38 AM
running a scr in rc3.d not as root, can i? kymberm UNIX for Advanced & Expert Users 6 11-12-2002 11:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-27-2007
Allasso Allasso is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 22
running X-11 programs as root

Hello,

I would like to run gedit as root while logged into my regular user account. When I try to launch gedit from the command line as super user, I get this message:

Gtk-WARNING **: cannot open display:

Any suggestions or word arounds? It would make my life a lot simpler to edit files from gedit that only have root write permissions

Thanks,

Allasso
  #2 (permalink)  
Old 12-27-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
as your normal user

Code:
xhost +`hostname`
echo $DISPLAY
switch to root

Code:
DISPLAY=whateverwasprintedbefore
export DISPLAY
however, becoming familiar with a common command line editor is a very useful skill.
  #3 (permalink)  
Old 12-27-2007
Allasso Allasso is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 22
Please ignore - (dummy post so I could subscribe to email notification)
  #4 (permalink)  
Old 12-27-2007
Allasso Allasso is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 22
Thank you, Porter, that did it. (though I hardly understand what I was doing there, just followed the recipe :-)

useful at times, yes, but sometimes quite tedious.

Thanks again,

Allasso
  #5 (permalink)  
Old 12-27-2007
ramen_noodle ramen_noodle is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2007
Location: Virginia, USA.
Posts: 251
Please don't do what was advised if you have security in mind. Use ssh tunneling + keys and the ssh-agent to allow root access to X based services.
  #6 (permalink)  
Old 12-28-2007
Allasso Allasso is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 22
fortunately security is not really an issue in my situation, but I do appreciate the advice.

Thank you.

Allasso
  #7 (permalink)  
Old 12-28-2007
Allasso Allasso is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 22
I heard this suggestion:

"To get around this and other idiotic privilege problems created by using sudo, I just open a gnome-terminal window and run "sudo bash". That will give you root privileges with the proper environment setup for starting GUI apps as root. It also allows you to continue running the rest of your GUI applications as a less privileged user."

What do you think?

Since Porter's suggestion works, I don't want to break it to try this out. In the past I have tried simply running " sudo GUIapplication " but I have found this not to be a good idea.
Sponsored Links
Closed Thread

Bookmarks

Tags
export display

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0