LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 09-05-2009, 09:36 PM   #1
farmerdave
Member
 
Registered: Mar 2008
Location: Adelaide, Australia
Distribution: Arch, Slackware 14.2, Fedora 27
Posts: 111
Blog Entries: 1

Rep: Reputation: 16
another 'cannot connect to X server' question


I am aware that slackware wont let you connect to X server as root for security reasons.
eg # kwrite /etc/X11/xorg.conf
will output the error 'cannot connect to X server'.

But my question is this; I am am using a terminal as root and then i issue
# su - david
and i still cannot use a command like the eg given above, the error 'cannot connect to X server' appears again. Is there a way around this? At the moment i open another tab in Konsole and this works, but would like to know the correct way to su.
 
Old 09-05-2009, 09:46 PM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
type su then enter then password. Or kdesu and the program you want to run kde su kwrite. now if you do this a couple times and then you cant use kwrite as super user then log out of the user then log in as root then log back out it will remove the stale lock file for the ICE.auth
if you have a full install and are not using 3 party nvidia drivers. type xorgsetup then after your done setting it up type kdm. then sign in as a user.

Last edited by Drakeo; 09-05-2009 at 09:58 PM.
 
Old 09-05-2009, 10:24 PM   #3
farmerdave
Member
 
Registered: Mar 2008
Location: Adelaide, Australia
Distribution: Arch, Slackware 14.2, Fedora 27
Posts: 111

Original Poster
Blog Entries: 1

Rep: Reputation: 16
My problem is not really with xorg.conf, or any file in particular. If I su from user -> root -> user, i cannot connect to X server as user any more. Can this be fixed somehow?
 
Old 09-06-2009, 12:51 AM   #4
saulgoode
Member
 
Registered: May 2007
Distribution: Slackware
Posts: 288

Rep: Reputation: 155Reputation: 155
Quote:
Originally Posted by farmerdave View Post
My problem is not really with xorg.conf, or any file in particular. If I su from user -> root -> user, i cannot connect to X server as user any more. Can this be fixed somehow?
If you include a minus sign when 'su'ing, the environment is switched to that of the new user. The problem with running X programs is that the $DISPLAY environment variable is lost. If you make note of what its value is before switching (it is typically ":0.0") then you can reset it after switching users (e.g., "DISPLAY=:0.0 kwrite").

When using 'su', you could omit the minus sign and thus retain the original user's environment. Alternately, when switching to root using 'su', the "-s" switch will cause retention of the $DISPLAY value (and the current working directory) but other environment variables (such as $PATH) will be updated.
 
Old 09-07-2009, 10:10 AM   #5
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Quote:
kdesu konqueror
try it. or alt + F2 then type kdesu and the name of the program you want to run as root.
this has been a nice security feature for the kde4 desktop and the kdesu is set up to work in xffce4 also.
the original ones that other distro's use are su- and that does not work in Slackware.
just keeping the back door closed. So you use the kdesu program to run as root.
 
Old 09-08-2009, 01:16 AM   #6
farmerdave
Member
 
Registered: Mar 2008
Location: Adelaide, Australia
Distribution: Arch, Slackware 14.2, Fedora 27
Posts: 111

Original Poster
Blog Entries: 1

Rep: Reputation: 16
Thanks, I will remember in future to use kdesu.

Would the $DISPLAY variable be reset if I were to create a .bashrc file? At the moment my installation of Slackware doesn't use one.
 
Old 09-08-2009, 11:39 PM   #7
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
read this this has been around a long time
 
  


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
realvnc server installed on fed9 attempting to connect to server from windows desktop nataloi Linux - General 1 04-21-2009 09:31 AM
pcbsd server processes question / server optimization (newbie question) leicaphotos Linux - Server 1 12-10-2008 06:40 AM
Unix-connect: can't connect to server jrdioko Linux - Software 1 01-08-2006 04:56 PM
Is samba required to connect to a Windows Advanced server from RedHat 8.0 server? NemesisStar Linux - Hardware 1 10-20-2003 12:32 AM

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

All times are GMT -5. The time now is 04:25 PM.

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