LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-21-2008, 02:57 PM   #1
james2b
Member
 
Registered: Feb 2007
Location: Washington state, USA
Distribution: Ubuntu Mate 18.04, Mint 19.1
Posts: 360

Rep: Reputation: 45
Question cannot connect to X server, in the konsole terminal as root


I get this; "cannot connect to X server", when in the konsole terminal as root user attempting to edit my xorg.conf file. So with; su -l, to get as the root, I then typed in; "kwrite /etc/X11/xorg.conf" to open this file to edit it for display resolution, but it would only give that error. So in Slackware 12.1 with KDE 3.5.9, and logged in as a regular user in the GUI run level, what text editor do I use, and how to make it able to connect to X server with a terminal as root? (su, or su -, or su -l, or this; su -c)? Thanks for help.
 
Old 11-21-2008, 03:04 PM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Try:
Code:
kdesu kwrite /etc/X11/xorg.conf
 
Old 11-21-2008, 04:32 PM   #3
x_terminat_or_3
Member
 
Registered: Mar 2007
Location: Plymouth, UK
Distribution: Fedora Core, RHEL, Arch
Posts: 342

Rep: Reputation: 38
Or, even better, when you open the file in your KDE application (Kate,Kwrite,Knotes,Quanta,Kedit,Kwhatever), type this in your location bar:

fish://root@localhost/

It will ask for your root password, and you can the proceed to edit the file. If it takes a while to edit, your password cache will have flushed, and you will have to retype it.

Very handy because it doesn't leave you with a program running with root privileges.

Last edited by x_terminat_or_3; 11-21-2008 at 04:33 PM. Reason: Spelling again must be my old(!) age
 
Old 11-21-2008, 05:05 PM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Or learn to use vim
 
Old 11-21-2008, 05:09 PM   #5
kukibl
Member
 
Registered: Jun 2008
Distribution: Gentoo
Posts: 88

Rep: Reputation: 28
Or type "xhost + local:" as normal user and then su to root.
 
Old 11-21-2008, 06:52 PM   #6
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Or use the CLI editors in a terminal like vi, nano, pico, joe, mcedit, ...

It would also be better to use `kdesu ...` as suggested by brianL instead of doing anything with xhost...there are possible security implications with xhost. kdesu at least only allows root access to that one specific X program and not the whole X server (and it only allows access for root and not every other user on the system in the case of multiuser systems).
 
Old 11-22-2008, 07:00 PM   #7
james2b
Member
 
Registered: Feb 2007
Location: Washington state, USA
Distribution: Ubuntu Mate 18.04, Mint 19.1
Posts: 360

Original Poster
Rep: Reputation: 45
Thumbs up

Thanks for all the help. I just logged into Slackware as root user, then I did the edit to my xorg.conf file, then I re-booted back in as standard user to make the display settings changes with the; NVIDIA X Server Settings tool, and saved to xorg.conf, and ran as root; nvidia-xconfig just to be sure. Then in the KDE display configuration I selected that box for the; "apply settings on KDE startup" option, which now does keep my 17" LCD at a native 1280 x 1024 resolution when I do a re-boot. So then the other Linux major distros work different than Slackware does for editing a system file as root user with a terminal, because I have used in the others; su -l , and it did work to edit my boot grub menu.lst file.
 
  


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
Using a local NX server to connect to a Windows terminal server on the Internet? roystonlodge Linux - Networking 1 07-26-2008 04:17 AM
can't connect to any server through terminal restles.s Linux - Networking 8 08-22-2007 02:47 AM
using fedora to connect to m$ terminal server jbzy3000 Fedora 6 03-05-2005 09:19 AM
Alternative terminal to konsole & gnome-terminal Adony Linux - Software 3 10-08-2004 03:59 AM
root cannot connect to an X server in a terminal GameboyHippo Linux - Software 4 02-09-2004 10:25 AM

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

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