SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Often when I have to get root access I use a text editor (if it's a lot of text /cut/paste etc) otherwise I use VI. When I call for a editor in a terminal:
kate etc/fstab
... it fails, and says that it can't load (or get access to) the X-server (or something similar) ... and YES, I am root ...
Is it possible to click my text editor's icon and then automatically get root priviligies (after passed the password) ???
If your answer is NO on this question ... what do I have to "fix" so that my example command above (kate etc/fstab) do start the editor when working in a terminal ???
you may also have to change the DISPLAY variable, type "export DISPLAY=0.0" after typing xhost localhost as the standard user like booster said. Note: The export command should be types in the terminal while logged in as root.
another alternative is rather than typing su - or su the way you likely are type su root which will give you root privlages but will transfer all your display stuff w/ it, however there are a few limitations, but you will not likely encounter them.
mucking around with xauthorities in this way
is not recommended, though. a reasonably
safe approach would be to do as follows from
an xterm ... (if X forwarding is enabled in sshd_conf)
OK, maybe it's me, but in my experience this is a KDE thing. You apparently can't open Kate, KWrite or KEdit in a terminal, as root or otherwise.
(I'm a GNOME user normally, so I notice these things.)
This appears to be why there is a "File Manager (Super User)" shortcut prominently placed in the menu (unlike in most other WMs/DEs, where if you want such a shortcut you have to make it yourself. For that purpose, I use a utility called gksu, whose purpose is to pop up the authentication box for entry of the root password, and then call the program when you hit Enter or click OK). I believe that KDE users are expected to browse to their file with the SU Konqueror FM and then right-click and choose "Open With". At least that's the only way I've ever found to do it.
Which is why I don't use those text editors, but rather one that does allow me to actually type its binary name into a terminal to be opened. In other words, any other one than a K-tool (gedit, joe, nano, pico, take your pick).
Originally posted by motub OK, maybe it's me, but in my experience this is a KDE thing. You apparently can't open Kate, KWrite or KEdit in a terminal, as root or otherwise.
(I'm a GNOME user normally, so I notice these things.)
This appears to be why there is a "File Manager (Super User)" shortcut prominently placed in the menu (unlike in most other WMs/DEs, where if you want such a shortcut you have to make it yourself. For that purpose, I use a utility called gksu, whose purpose is to pop up the authentication box for entry of the root password, and then call the program when you hit Enter or click OK). I believe that KDE users are expected to browse to their file with the SU Konqueror FM and then right-click and choose "Open With". At least that's the only way I've ever found to do it.
Which is why I don't use those text editors, but rather one that does allow me to actually type its binary name into a terminal to be opened. In other words, any other one than a K-tool (gedit, joe, nano, pico, take your pick).
Like I said, maybe it's me.
Motub,
No offense at all or anything - i know you use GNOME - , but that's not quite true about KDE. KDE has a nearly identical utility to gksu; it's called kdesu. If you run 'kdesu [whatever]', then that pops up an authentication window and runs the thing as root. Also, under both Run Command...->advanced and the Menu Editor, there is an option that you can fill in to 'Run as a different user'. By the way, that's all that the "File Manager (Super User)" shortcut is; it's nothing special - it's just convenient that KDE comes with it by default.
Last edited by smith847be; 02-23-2004 at 09:47 PM.
Why would I be offended? It's good to know that there is a similar utility for KDE, as I find gksu invaluable. So that means that the original poster can use it to create shortcuts or panel entries to point to Kate or whatever, I would assume. That is then one answer to the original question, but does not explain why I can type "gedit" in a terminal and have gedit open, but if I type Kate, kate, or any of the K text editor binary names in a terminal, I get a not found error and the program doesn't open. Are the K-tools not in my $PATH$ or something?
Oh, and apologies for any weird formatting in this post; it's the first time I've used lynx to post on any forums, and I'm not such a lynx master (as nice as the browser is) that I know how to avoid any possible mistakes.
motub,
"Why would I be offended?" - I don't know, I just don't want people to feel insulted or whatever if I correct them. Nevermind. That's weird, though, that you'd get not found errors in a terminal; And you can launch it just fine by a menu or 'run command...' box? All the distros I've heard about install KDE apps in the same place as the rest of the user program executables (usually /usr/bin). Try just doing a 'locate kate' command. Then take a look at 'echo $PATH', and see if the directory is listed. Except that the menus and stuff should be using the same PATH variable for launching. That's weird. And just to make sure I'm interpretting right, the not found error is saying that the binary is not found? (not e.g. that the QT lib files aren't found - since that's common)? P.S. there's no weird formatting in your post.
That is one of the nice things about pico. You can cut and paste into it with no problem (if you have GPM correctly configured) and since it is not a gui text editor you have no problems starting it as root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.