LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   Using root in X, how to run apps as a usr ? (http://www.linuxquestions.org/questions/linux-security-4/using-root-in-x-how-to-run-apps-as-a-usr-182615/)

Dark Carnival 05-17-2004 06:20 PM

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

witeshark 05-17-2004 11:03 PM

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

-Nw- neX 05-18-2004 03:03 AM

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


-Nw- neX 05-18-2004 03:04 AM

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

Dark Carnival 05-18-2004 05:49 AM

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 ?

int0x80 05-20-2004 10:45 PM

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

-Nw- neX 05-25-2004 04:06 PM

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.


All times are GMT -5. The time now is 12:40 PM.