LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 04-10-2003, 04:29 PM   #1
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Rep: Reputation: 64
X apps from console after su


When I had mandrake, I could start X apps from the console after su to root. Now I get:

root@darkstar:/home/toby# nmapfe
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


Gtk-WARNING **: cannot open display: :0.0
root@darkstar:/home/toby#

I think I need to enable sudo?

can anyone help me here?
 
Old 04-12-2003, 01:49 AM   #2
320mb
Senior Member
 
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
check the sudoers file in /etc and see if user and the proper permissions. Slack 9 seems to configure differently for everyone, also look at the package installer, and see if "sudo" is installed, mine is version 1.6.6
 
Old 04-13-2003, 04:06 PM   #3
fskmh
Member
 
Registered: Jun 2002
Location: South Africa
Distribution: Custom slackware64-current
Posts: 307

Rep: Reputation: 92
su -l
 
Old 04-14-2003, 02:19 PM   #4
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Original Poster
Rep: Reputation: 64
thanks for your replies, but I did not make myself clear.
I thought sudo was maybe what I needed to setup, but it is not the case.
I can su to root ok, but I cant start an X display for root if I log on as user. I read elsewhere that I need to use xhost + , but this was not necessary in the previous distro I was using. The example I gave was nmapfe, which has different options available as root, so I used to launch it from a console in which I had su'd to root.
 
Old 04-14-2003, 02:51 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
no, nothign to do with sudo. run this - "xhost +localhost" and that will let anyone locally conenct to the x server.
 
Old 04-14-2003, 02:53 PM   #6
notAcoolNick
Member
 
Registered: Apr 2003
Location: Oxford, MA, USA
Distribution: Slackware
Posts: 89

Rep: Reputation: 16
Cool

I don't know the reason behind this (security?). But to allow other users to use your display you have to spell it out now in your ~/.xinitrc file (or just from command line from a termnial emulator) that your box is one of the xhosts.
So simple:
xhost name_of_your_box
in .xinitrc or command line will let you have what you want.
General rule, don't use sudo if you don't have to.
best regards.
 
Old 04-14-2003, 03:08 PM   #7
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Original Poster
Rep: Reputation: 64
thanks a lot!
I shall experiment
 
Old 04-14-2003, 03:10 PM   #8
notAcoolNick
Member
 
Registered: Apr 2003
Location: Oxford, MA, USA
Distribution: Slackware
Posts: 89

Rep: Reputation: 16
you can probably achieve the same with /etc/X11/XF86Config but i don't know how.
 
Old 04-15-2003, 02:31 PM   #9
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Original Poster
Rep: Reputation: 64
I solved the problem. When I used mandrake, I always used to add '-nolisten TCP' to the kdm Xservers file. This stopped X from listening with the port 6000 open, which I considered a potential security risk. It never prevented me from opening apps from the console as root.
I did this immediately when I got Slackware installed, but it seems to make a much bigger difference with Slack, because after removing this I was ok again.
I will just have to rely on my firewall I guess, though I liked the 'boots and braces' approach, and the first thing I do after installation is try and make my box secure.( I still use Shorewall as a firewall, which I find very good)
Thanks for all your help.
 
Old 04-15-2003, 02:57 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
That's overkill, mate...

all you need to do is add
xhost +localhost to your normal users profile
and export DISPLAY=localhost:0.0 to roots...


Cheers,
Tink
 
Old 04-15-2003, 04:01 PM   #11
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Original Poster
Rep: Reputation: 64
Would that be ~/.bashrc or ~/.profile?
Either way I need to create one as my fresh install has neither, I reckon I can make one up though...
 
Old 04-15-2003, 04:24 PM   #12
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
depends on whether the terminal you use
starts as a login-shell or not :)

If it is, put it in .bash_profile or .profile, if
it's not, put it in .bashrc ...
Code:
man bash
/INVOCATION
for more detail...


Cheers,
Tink
 
Old 04-15-2003, 05:05 PM   #13
notAcoolNick
Member
 
Registered: Apr 2003
Location: Oxford, MA, USA
Distribution: Slackware
Posts: 89

Rep: Reputation: 16
tobyl,
putting xhosts into .bashrc is not going to work. at least in case if you do not use any of *dm (gdm, xdm, kdm etc.). because at the moment when your bashrc and profile are sourced no X server is running and DISPLAY variable is not set.
1) it will not brake you back to type "xhost ..."
2) if you want to do it automatically you have to use X related init scripts such as .xinitrc (or probably .xsession if you use *dm)
 
Old 04-15-2003, 05:08 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
notAcoolNick is right, I shouldn't be posting
in the early morning ;)

xhost +localhost has to go in your normal users
.xsession file :)

Cheers,
Tink (yawn)
 
Old 04-16-2003, 04:37 PM   #15
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 768

Original Poster
Rep: Reputation: 64
Thankyou both. I appreciate your help. I guess it is not that important to automate a one line command, I just like getting things 'just so'.

tobyl
 
  


Reply



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
Silly Querstion RE: Opening apps from console Boyer Linux - Software 2 06-15-2005 07:24 PM
cannot open X apps from a root console window flieslikeabeagl Slackware 8 10-15-2004 02:13 PM
Some apps run from console but not desktop unholy Linux - General 2 11-05-2003 03:19 PM
Where have all my console apps gone? JordanH Red Hat 2 11-01-2003 09:14 PM
using custom fonts for console apps Beav Linux - General 1 09-28-2002 10:43 AM

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

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