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 11-12-2002, 03:25 PM   #1
lusko
LQ Newbie
 
Registered: Nov 2002
Location: Paris
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
Question cannot start programs as another user


Hi all,

When i'm logged as normal user and su to root, cannot start other programs as root from shell. Same with other users. For example typing $ konqueror& I get
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

konqueror: cannot connect to X server :0.0

or
typing $ xmms&

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


** CRITICAL **: Unable to open display

any hints?
thanks,
Lusko
 
Old 11-12-2002, 04:18 PM   #2
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
try this to allow access by user to X server

xhost + username
 
Old 11-13-2002, 09:38 AM   #3
lusko
LQ Newbie
 
Registered: Nov 2002
Location: Paris
Distribution: Slackware
Posts: 11

Original Poster
Rep: Reputation: 0
it's not working..

the user i'm trying to give access to X is "testing" when i'm logged as lusko. this is what i did

root@darkstar:~# xhost +testing
xhost: unable to open display ""
root@darkstar:~# exit
logout
lusko@darkstar:~$ xhost +testing
xhost: bad hostname "testing"
lusko@darkstar:~$

thanks,
lusko
 
Old 11-13-2002, 09:57 AM   #4
NSKL
Senior Member
 
Registered: Jan 2002
Location: Rome, Italy ; Novi Sad, Srbija; Brisbane, Australia
Distribution: Ubuntu / ITOS2008
Posts: 1,207

Rep: Reputation: 46
just do
xhost +
as testing
then su to root and try to run a program.
Also man xhost is helpful.
-NSKL
 
Old 11-13-2002, 11:16 AM   #5
lusko
LQ Newbie
 
Registered: Nov 2002
Location: Paris
Distribution: Slackware
Posts: 11

Original Poster
Rep: Reputation: 0
k, i did..

testing@darkstar:~# xhost +
xhost: unable to open display ""

then i root
root@darkstar:~# emacs&
[1] 787
root@darkstar:~# vim&
[2] 788

[1]+ Stopped emacs
root@darkstar:~#

[2]+ Stopped vim
root@darkstar:~# konqueror&
[3] 789
root@darkstar:~# konqueror: cannot connect to X server

[3] Exit 1 konqueror

cannot open anything..


help appreciated.. thanks
 
Old 11-13-2002, 11:57 AM   #6
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
Quote:
Originally posted by lusko
it's not working..

the user i'm trying to give access to X is "testing" when i'm logged as lusko. this is what i did

root@darkstar:~# xhost +testing
xhost: unable to open display ""
root@darkstar:~# exit
logout
lusko@darkstar:~$ xhost +testing
xhost: bad hostname "testing"
lusko@darkstar:~$

thanks,
lusko
When you are logged in as lusko, type xhost +<your_host_name || user_name>, or xhost + (man xhost for more info). Then, log in as testing. At this point, testing should be able to open the XFree86 display through lusko since lusko allows other connections through its current connection.

BTW, when you see something like unable to open display "", it means that the evironment variable DISPLAY is not defined for the current user that is trying to open an XFree86 connection. Therefore, you would have to create it like the following:
(assuming you are using an sh derivative)
export DISPLAY=:0 <- as long as it is your localhost, otherwise you would type the following export DISPLAY=<hostname>:0.

GL

P.S. You have to be logged in straight into lusko, otherwise if you log in as,. . . hmmmmm. . . let's see. . . ROOT! (hope this is not a habit), then you have to make the same calls for root, before making them to lusko. . .

/edit: added P.S.

Last edited by LNXman; 11-13-2002 at 12:00 PM.
 
Old 11-13-2002, 01:23 PM   #7
lusko
LQ Newbie
 
Registered: Nov 2002
Location: Paris
Distribution: Slackware
Posts: 11

Original Poster
Rep: Reputation: 0
it works!

K it works, thanks a lot LNXMan

i was able to launch konqueror through lusko logged in as testing, however got a bunch of errors..

lusko@darkstar:~$ su testing
Password:

I once witnessed a long-winded, month-long flamewar over the use of
mice vs. trackballs... It was very silly.
-- Matt Welsh


testing@darkstar:/home/lusko$ konqueror&
[1] 1711
testing@darkstar:/home/lusko$ sh: iceauth: command not found
ICE Connection rejected!

DCOPClient::attachInternal. Attach failed Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
ICE Connection rejected!

DCOPClient::attachInternal. Attach failed Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
DCOPServer self-test failed.
sh: iceauth: command not found
kdeinit: DCOPServer could not be started, aborting..
 
Old 11-13-2002, 04:02 PM   #8
lusko
LQ Newbie
 
Registered: Nov 2002
Location: Paris
Distribution: Slackware
Posts: 11

Original Poster
Rep: Reputation: 0
k, i'm getting closer. After extensively searching the net for answers i found out that the problem has to do with DCOPserver, KDE's Desktop Communications Protocol, and a PATH problem to iceauth. i tried to start it typing $ dcopserver and got the exactly same error. What i find really weird is that even when getting those errors the application launches. Is it maybe just a simple PATH problem dealing with iceauth?? i see iceauth when su - only and not when i su (without -)?? same for normal users. where should i look at now? what's the best way to fix this??
thanks in advance for all ur help!
 
Old 11-13-2002, 10:01 PM   #9
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
You are right when you say there may be a path problem. What you should do is su - <user_name>. Once you are <user_name> then you have to create the DISPLAY environment variable as I mentioned in my previous post
. . . export DISPLAY=:0 . . . blah, blah

Give that a shot.

GL
 
Old 11-14-2002, 01:23 AM   #10
lusko
LQ Newbie
 
Registered: Nov 2002
Location: Paris
Distribution: Slackware
Posts: 11

Original Poster
Rep: Reputation: 0
works perfectly! thanks!!!
 
Old 11-14-2002, 01:38 AM   #11
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
Quote:
Originally posted by lusko
works perfectly! thanks!!!
De rien
 
Old 11-30-2002, 04:43 PM   #12
Cyclops
Member
 
Registered: Jul 2002
Location: Earth
Distribution: Slack 9.1
Posts: 70

Rep: Reputation: 15
Question More info needed regarding this...

Hello LNXman, or anyone else that can help. I frequently run into this problem in Slackware, too, but never in when in Redhat and/or Mandrake.

Is there some place that these commands can be inserted to make them permanent? TIA...
 
Old 11-30-2002, 05:24 PM   #13
LNXman
Member
 
Registered: Jul 2002
Location: California (USA)
Distribution: Slackware
Posts: 97

Rep: Reputation: 15
There are a couple things you can do:

You can add as small hack to set the DISPLAY variable whenever you use: su - to the global profiles under /etc, or to the local user's shell profile you use under ~/.<shell_profile_file>

Consequently, you can alias su under the profile you decide to use like this: alias su='/bin/su -'. Such that you don't forget to load profiles when su-ing.

(Assuming you are playing with a server)
Just take into consideration WHO you are giving these settings to. Do you want to make them global for everyone (just to be nice), or specific user's or group's. What about root? Or you just don't care. . . Just a few questions for you to consider when hacking away. . . Have fun.

GL
 
  


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
Getting programs to start browser Slackware 5 07-29-2005 09:36 AM
Programs in FluxBox take ages to start or don't start at all hubabuba Slackware 1 02-20-2005 09:21 AM
cannot start kdeas user ,can start icewm,fluxbox jackren Debian 1 02-29-2004 11:06 PM
automaically start programs towhalc Linux - Software 3 12-30-2003 08:38 AM
Why i can't start programs!?? FreakboY Linux - Software 5 09-13-2002 02:20 AM


All times are GMT -5. The time now is 02:18 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