LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-13-2004, 09:54 PM   #1
nny0000
Member
 
Registered: Aug 2003
Distribution: Slackware, Ubuntu
Posts: 158

Rep: Reputation: 30
Running root apps in X using regular user?


Since it is a very bad idea to run X under root. Is there a way to run X under a regular user and open xterm and su to root and type in the program (any X based application that requires root privledges) and have it show up on the non-root user's screen? I keep getting errors, from can't connect to display:0.0 and invaild MIT_MAGIC_COOKIE.
Also if this is possible is it a security risk ( besides leaving the xterm with root logged on)?
I just don't want to shutdown X and sign back on with root!!

A Slacker
 
Old 01-13-2004, 10:13 PM   #2
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Rep: Reputation: 120Reputation: 120
Out of curiosity what aps do you want to run?

Can't think of too much I need to do but access file manager and editor as root. Other han accessing gui config ap for kernel compile boot then that can be done as a regular user.

MC handy enough if ls isn't enough gun. I use mcedit but many folks use pico, vi and the like.

But that's me and my needs.
 
Old 01-13-2004, 10:18 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you type kdesu and the app, a requester will pop up asking for the root password, then the app will start.
 
Old 01-14-2004, 01:04 PM   #4
nny0000
Member
 
Registered: Aug 2003
Distribution: Slackware, Ubuntu
Posts: 158

Original Poster
Rep: Reputation: 30
No application in particular, but sometimes I run into needing a X program that needs root access (like a GUI port scanner). I just want to be able to run X under a regular user and open a xterm,su to root and type in the program and have it show up on the users screen. Is this possible and/or a security risk?

Thanks
A Slacker and proud of it

Last edited by nny0000; 01-14-2004 at 01:07 PM.
 
Old 01-14-2004, 05:11 PM   #5
CrashedAgain
Member
 
Registered: Jan 2004
Posts: 307

Rep: Reputation: 33
I don't really understand why it's considered to be a security risk to run x as root. Sure it's a bad idea to go online while logged in as root but that is a totally different issue. There is no reason that just running a 'window manager' or a gui application as root should make your system less secure.
I do this all the time. I regularly use KDE apps as root, most frequently Konqueror, Kate. I have icons for these on the desktop setup to run as root using KDE's 'run as a different user' setting.
 
Old 01-14-2004, 05:43 PM   #6
afunke
LQ Newbie
 
Registered: Feb 2003
Location: Curitiba - Brazil
Distribution: Mandrake 9.2
Posts: 14

Rep: Reputation: 0
To prevent the "can't connect to display 0:0" error you may type the following command, as regular user, before you "su" to root:

xhost +
 
Old 01-14-2004, 08:15 PM   #7
laydros
Member
 
Registered: Jun 2003
Location: Raleigh, NC, US
Distribution: Slackware
Posts: 63

Rep: Reputation: 15
with dropline, a lot of the gui apps under gnome, like login screen manager and stuff give you that x su screen, and let you type in the root pass to run the app.

distros like redhat do it out of the box, so i knwo there is a way to set it up
 
Old 01-14-2004, 09:59 PM   #8
newinlinux
Member
 
Registered: Dec 2003
Location: Next to Equator
Distribution: GNU/Linux 2.6.14
Posts: 382

Rep: Reputation: 30
Quote:
Originally posted by CrashedAgain
I don't really understand why it's considered to be a security risk to run x as root. Sure it's a bad idea to go online while logged in as root but that is a totally different issue. There is no reason that just running a 'window manager' or a gui application as root should make your system less secure.
I do this all the time. I regularly use KDE apps as root, most frequently Konqueror, Kate. I have icons for these on the desktop setup to run as root using KDE's 'run as a different user' setting.
I was as puzzled too, seemingly the root thingy is always get into our ways. But if we recall the root(pun not intended) of linux, which is unix, then we will understand why it is so. it is a networked OS, it is meant to be running servers, where users are all log inned and uptime is crucial. So the security risk is that a server can be comprised if a non system/network admin mess with it. So IMO, Linux is like a server based OS trying to also act as an Desktop, and MS is a desktop OS trying to act as an server. They have their historical baggages, but both are making progress towards their goal.
 
Old 01-15-2004, 02:55 AM   #9
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 878

Rep: Reputation: 120Reputation: 120
You may not be worried about security and want the convenience of a gui root and it's your choice but there will be no messages saying you do not have permission when you start doing things you didn't intend to do to your system and deleting things you didn't mean to.

Root also makes you stop and think "yeah what am I doing here?" and when your root on a terminal your looking at what you intend to do as you type the command and hit enter. In an xsession your just one click away (intentional or not intentional) from blowing away all your hard work or a network with clients on it.

I used to install SuSe a couple times a week when I first started cause I I was always in root and didn't know the first thing about half of what I was thinking I was doing.

Yes there are still some times when I might logon as root in kde but after three years plus messing around with linux I now stop and think about whether I really need to and many times I don't. I can do it as su in konsole while logged in as a normal user.
 
Old 01-15-2004, 06:57 AM   #10
kadaver
Member
 
Registered: Nov 2003
Location: Beautiful Northern-sweden (Luleå)
Posts: 90

Rep: Reputation: 15
Use 'sudo'
code:

sudo <program name>

assuming the program is in your sudoers file (/etc/sudoers). This approach is far more secure than changing the permissions of your programs and/or using the 'su' command. Passing the command 'man sudoers' in a terminal will give you a document pertaining to the syntax of the sudoers file. And btw, the help file says that you have to use the 'visudo' command to edit the file. But as long as you understand the syntax of the file you can use your favourite editor (such as jed!). Cheers!
 
Old 01-15-2004, 12:23 PM   #11
nny0000
Member
 
Registered: Aug 2003
Distribution: Slackware, Ubuntu
Posts: 158

Original Poster
Rep: Reputation: 30
Thanks for all the help
 
  


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
Moving from root to regular user KingOfDreams Linux - General 1 01-14-2005 04:46 AM
Given regular user root privileges clo99dx Linux - Newbie 6 06-05-2004 04:27 PM
running k3b from a regular user devit Slackware 1 03-11-2004 09:29 AM
root apps running on X under regular user?? nny0000 Slackware 3 02-05-2004 02:09 PM
can't login as regular user (root only) DontKnowNothing Mandriva 2 10-24-2003 01:36 PM

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

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