Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
10-02-2005, 01:41 PM
|
#1
|
Member
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159
Rep:
|
su then open program in X fails
I used to be able to do this no prob... now I can't and I have no idea what changed. I'm on a fresh 10.2 install. What I would like to be able to do is su to another user and then open a program as that user. For instance firefox. However when I do this I get.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
(firefox-bin:5392): Gtk-WARNING **: cannot open display:
any suggestions?
|
|
|
10-02-2005, 01:48 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
Try That should let you inherit X.
|
|
|
10-02-2005, 01:54 PM
|
#3
|
Member
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159
Original Poster
Rep:
|
I don't seem to have sux. I tried xhost +localhost which I saw was supposed to let me open things as another user and that didn't work either.
|
|
|
10-02-2005, 01:57 PM
|
#4
|
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507
Rep:
|
Try sudo instead of su.
|
|
|
10-02-2005, 02:01 PM
|
#5
|
Member
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159
Original Poster
Rep:
|
Code:
sudo -u user firefox
gives the same error. I see that this is some sort of X server security feature, but it is damnably inconvenient.
|
|
|
10-02-2005, 02:15 PM
|
#6
|
LQ Newbie
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 12
Rep:
|
It should work this way, first in the terminal write
then
and then run any application you'd like to run like xcalc
Let us know what goes with you.
|
|
|
10-02-2005, 02:38 PM
|
#7
|
Member
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159
Original Poster
Rep:
|
gives: localhost being added to access control list
gives: /dev/pts/0: Operation not permitted
gives: Error: Can't open display:
|
|
|
10-02-2005, 02:54 PM
|
#8
|
Member
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159
Original Poster
Rep:
|
Ok so I did
which disables access control and now It works. Is this a major security hole? I'm not sure how the x server would handle connections but
doesn't show an open x port.
|
|
|
10-02-2005, 03:40 PM
|
#9
|
Senior Member
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721
Rep:
|
xhost + will allow anyone to connect to your x server.
it's a securety risc.
<there was some nonsense here before editing...>
if i use " su " --->gui programs work ok without doing any settings.
if i use " su - " --->things don't work ( which is logic )
egag
Last edited by egag; 10-02-2005 at 04:35 PM.
|
|
|
10-02-2005, 04:15 PM
|
#10
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep: 
|
Re: su then open program in X fails
Quote:
Originally posted by uopjohnson
I used to be able to do this no prob... now I can't and I have no idea what changed. I'm on a fresh 10.2 install. What I would like to be able to do is su to another user and then open a program as that user. For instance firefox. However when I do this I get.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
(firefox-bin:5392): Gtk-WARNING **: cannot open display:
any suggestions?
|
I guess that either you start your xserver with "-auth" or you use "KDM/XDM/GDM/etc".
You can use "xhost" but it is insecure.
The proper way is to use xauth authentication.
you run "xauth list" as the user that is running the xserver (the first user)
you will get some authentication keys
copy the one that is starting as "hostname/unix:0"
then su to the user you want to start the program as (the second user)
(dont run "su -" just plain "su")
then run "xauth add KEY_LINE" where KEY_LINE is the key you copied from the other user.
KEY_LINE is the whole line (it is something like this "hostname/unix:0 MIT-MAGIC-COOKIE-1 big_key")
you copy all this thing.
then every X application should work for the other user.
if you run "su -" then you get a login shell and it has the enviroment the user would have if he logged in.
then all the procedure is the same except for an addition. you should set the DISPLAY enviroment variable
(for example in a bash shell "export DISPLAY=":.0" )
|
|
|
10-03-2005, 08:29 PM
|
#11
|
Member
Registered: Jun 2004
Location: San Francisco
Distribution: Slackware, Ubuntu, RHEL, OS X
Posts: 159
Original Poster
Rep:
|
Ok... so that allows me to open things, but it does not open them as the sued to user. It opens them as the original user.
|
|
|
10-05-2005, 11:28 AM
|
#12
|
LQ Newbie
Registered: Mar 2004
Distribution: Slackware/Suse/CentOS
Posts: 17
Rep:
|
I am having the same problem with using su to run a program from the command line for another user. The su command was working eariler on when I was configuring my system after installing Slackware 10.2. I noticed recently that it was not working anymore. I think it might be caused by the [slackware-security] X.Org pixmap overflow (SSA:2005-269-02) patch that was released by Pat. I haven't been able to test my theory yet, but will later today hopefully, if I have time, and I will post the results.
|
|
|
10-05-2005, 11:49 AM
|
#13
|
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slack -- current
Posts: 354
Rep:
|
kde has a solution to this. If you use kde go to the "run command" option in the start (k) menu and enter to open firefox as root.
|
|
|
10-05-2005, 02:40 PM
|
#14
|
LQ Newbie
Registered: Mar 2004
Distribution: Slackware/Suse/CentOS
Posts: 17
Rep:
|
For me and probably others, not everyone uses KDE. I personally use Window Maker on my Slack Box. So a real solution to the problem should be found rather than putting a band aide on it.
|
|
|
10-05-2005, 03:51 PM
|
#15
|
Member
Registered: May 2005
Location: Greece
Posts: 441
Rep: 
|
Quote:
Originally posted by jayptr
For me and probably others, not everyone uses KDE. I personally use Window Maker on my Slack Box. So a real solution to the problem should be found rather than putting a band aide on it.
|
jayptr didn't the method with xauth i described work for you ?
i use slackware-current, so i have the updated X packages and i also use Windowmaker but it works ok for me.
Also, kdesu works in windowmaker too as every other KDE program. you don't have to use kde to use Kwrite for instance.
And if you don't like it there are many other "graphical su" programs
|
|
|
All times are GMT -5. The time now is 10:14 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|