LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-17-2004, 05:20 PM   #1
Dark Carnival
Member
 
Registered: Jun 2003
Posts: 166

Rep: Reputation: 30
Using root in X, how to run apps as a usr ?


Hey!

Now despite people telling me not to, I started with linux running root (in X) and I honestly don't think I can stop it (they say power corrupts ? hehee > ) anyway as any root user knows, I'll be the target of programs telling me what I can and cannot do (namely use my root account)

Right now it's gtk-gnutella but I've tried this with wine configuration tools and such before... Now I understand it's a security risk, and an even greater one when it comes to running apps as gnutella. So I made a second user, called p2p to run all kinds of apps that didn't like my root account.

Problem is, it spits out a few xlib errors and it's over. I logged in as root (as I always do) and started x, then a terminal using su to become p2p and then I tried launching it. Failure, xlib complains.

Now is there any way I can actually do all this ? Some startup script or something ? I just want to be able to run these programs as a usr so they won't complain and I won't further cripple the security on the machine.

Thanks for your attention
 
Old 05-17-2004, 10:03 PM   #2
witeshark
Member
 
Registered: Jan 2004
Location: Miami FL
Distribution: Mac OS X 10.4.11 Ubuntu 12.04 LTS
Posts: 429

Rep: Reputation: 30
When you are on as root, SU doesn't work - that's for other permitted user to become root temporarily. Sign on as P2P after you (as root) have assigned permissions to the apps and files you want that user to have access to. Please don't be on line as root, but I think you know this
 
Old 05-18-2004, 02:03 AM   #3
-Nw- neX
Member
 
Registered: Apr 2004
Distribution: Gentoo, RHL, CentOS, Ubuntu, FreeBSD,
Posts: 88

Rep: Reputation: 15
you can su from root. you just have to tell su who to change to. looks like this.

Code:
[root@c0re nex]# su nex
[nex@c0re nex]$ whoami
nex
[drew@c0re nex]$ exit
exit
[root@c0re nex]# whoami
root

Last edited by -Nw- neX; 05-18-2004 at 02:07 AM.
 
Old 05-18-2004, 02:04 AM   #4
-Nw- neX
Member
 
Registered: Apr 2004
Distribution: Gentoo, RHL, CentOS, Ubuntu, FreeBSD,
Posts: 88

Rep: Reputation: 15
you can su from root. you just have to tell su who to change to. looks like this.

Code:
[root@c0re nex]# su nex
[nex@c0re nex]$ whoami
nex
[drew@c0re nex]$ exit
exit
[root@c0re nex]# whoami
root
dammit... admins please kill one of these. hit submit twice. :P

Last edited by -Nw- neX; 05-18-2004 at 02:08 AM.
 
Old 05-18-2004, 04:49 AM   #5
Dark Carnival
Member
 
Registered: Jun 2003
Posts: 166

Original Poster
Rep: Reputation: 30
Sure you can, but Xlib will fail if you open any gui app such as gtk-gnutella. Someone mentioned that it had something to do with the fact that X is launched by another user (in this case : root) and therefore the su'ed user can't run anything in X....

Is there a workaround ?
 
Old 05-20-2004, 09:45 PM   #6
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Some apps have to be run as root (namely ethereal). Just login as your regular user, and use root sparingly. If you absolutely need to run something as root, and you've thoroughly evaluated the situation, you can run as root by:

su -c /path/to/application
 
Old 05-25-2004, 03:06 PM   #7
-Nw- neX
Member
 
Registered: Apr 2004
Distribution: Gentoo, RHL, CentOS, Ubuntu, FreeBSD,
Posts: 88

Rep: Reputation: 15
ive honestly never had a problem running GUI progs su'd to root from x/a/e/gterm. sometimes helps if you put an & after the command. just tells the shell to 'run this and put me back on a command line'.

Code:
[root @ hivemind] /var # ethereal &
sometimes you will get some console output dumped to your root terminal, but its not really a big deal.
 
  


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
SuSE 10, KDE 3.4: OpenGL apps only work when run as root pschoenb Linux - Software 1 11-10-2005 01:43 PM
Can I mount, say, /usr/src , /apps , and /home on one hda1??? kornerr Linux - Newbie 13 02-01-2005 02:43 AM
can't run x apps iomari Linux - General 2 11-22-2004 02:00 AM
Can't run X apps as root michaely Debian 13 07-18-2004 04:47 AM
using cdburner as a usr - not as root? ursar Linux - Newbie 4 01-08-2004 11:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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