LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-24-2003, 09:41 PM   #1
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Run kde apps as superuser?


Can I start kwrite as superuser from kde?
I try to run it from xterminal (after su -l) but I only get an error message:
Cannot connect to xserver

I wonder why, since so far as I remember I could do this in Blackbox.
 
Old 03-25-2003, 12:14 PM   #2
newbieME
Member
 
Registered: Mar 2003
Location: BC Canada
Distribution: Slack Niner ;)
Posts: 185

Rep: Reputation: 30
did you try to go to under k menu, run application and start kwrite from there? but that wouldn't start the app in super user mode though...you can just log in as root and run it but i am sure there are other&better ways to do it...
 
Old 03-25-2003, 02:00 PM   #3
twan
Member
 
Registered: Feb 2003
Location: Brasschaat, Antwerpen - Belgium
Distribution: Gentoo
Posts: 52

Rep: Reputation: 15
i would recommend you not to use the root login to often

too dangerous to fuck it all up. Almost everyone uses a 'user' login here..

but if you don't believe then you'll just learn it the hard way
 
Old 03-25-2003, 05:01 PM   #4
mhearn
Guru
 
Registered: Nov 2002
Location: Durham, England
Distribution: Fedora Core 4
Posts: 1,565

Rep: Reputation: 47
Use kdesu,

kdesu kwrite

but as pointed out, using root for gui apps is rare.

FYI, the reason you get that error is because only the user you logged in as can display things to the screen normally unless you do some security related stuff.
 
Old 03-25-2003, 06:56 PM   #5
moaltmann
LQ Newbie
 
Registered: Mar 2003
Location: A and UK
Distribution: Debian (KDE 2.2.2)
Posts: 1

Rep: Reputation: 0
.Xauthority is the key

Dear J_Szucs: before using my script below consider whether it is in fact necessary for you to use kwrite. There are many text-only replacements (e.g. editor) which support basic text editing too.
newbieME: i am sorry, but your suggestion to logon KDE directly as root is among the worst as this completely exposes the system when most of the time a simple su will do.
personal recommended solution: below you find a shell script which is fairly simple and does not compromise on your system security. I named it mysu to make it clear that it is not the simple su command, though one could alias it to replace the su command. The script has to be placed in any directory included in $PATH and must me marked executable (e.g. chmod a+x mysu)

# /usr/local/bin/mysu
# script allowing su to access X-server from logged-in non-root user
# for feedback (i am really a newbie) mischa.delete-this-part@altmann.at

# point $XAUTHORITY to current user's .Xauthority file
# .Xauthority stores authorization keys for X-system of current user
# $XAUTHORITY is an environmental variable pointing to the file
# containing keys. If it doesnt exist X defaults to $HOME/.Xauthority
XAUTHORITY=$HOME/.Xauthority

# let new processes inherit environment variable $XAUTHORITY
export XAUTHORITY

# login as superuser (su)
su

# remove "export attribute" from $XAUTHORITY
export -n XAUTHORITY

I hope this helps,
. Mischa Altmann
 
Old 03-26-2003, 08:05 AM   #6
newbieME
Member
 
Registered: Mar 2003
Location: BC Canada
Distribution: Slack Niner ;)
Posts: 185

Rep: Reputation: 30
Quote:
Originally posted by moaltmann
newbieME: i am sorry, but your suggestion to logon KDE directly as root is among the worst as this completely exposes the system when most of the time a simple su will do.
thus the statement

Quote:
Originally posted by newbieME
there are other&better ways to do it...
 
Old 03-26-2003, 11:28 AM   #7
Who
LQ Newbie
 
Registered: Mar 2003
Distribution: Slackware
Posts: 7

Rep: Reputation: 0
Here's how I do it on KDE:

alt+F2 gets me a RunCommand dialog. I can enter "kwrite" as the program to run, then expand the Options and choose "Run as a Different User," username is 'root' and enter the password for that user. Now I'm in kwrite with root permissions. I can't think of any reason why this would make problems.
 
  


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
SuSE 10, KDE 3.4: OpenGL apps only work when run as root pschoenb Linux - Software 1 11-10-2005 01:43 PM
can't run x apps iomari Linux - General 2 11-22-2004 02:00 AM
KDE malfunctions, Apps won't run from kicker or desktop TMVanatta Linux - General 1 10-25-2004 09:20 AM
KDE file manager (superuser) in fluxbox wendykroy Linux - Software 2 09-28-2004 03:10 AM
Superuser password problem - KDE 3.1 on FreeBSD nomowindoze Linux - Newbie 9 07-20-2004 11:25 AM


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