View previous topic :: View next topic |
Author |
Message |
GNUtoo Veteran
Joined: 05 May 2005 Posts: 1919
|
Posted: Fri Aug 31, 2007 9:28 pm Post subject: how to prevent a program to run as root?[solved] |
|
|
sometimes i don't pay attention at the status of the console(if it's root or not) and i run eclipse as root...
how do i prevent it running when i'm root
Code: | # eclipse-3.3
!!! You are running Eclipse as root. Be advised that this will modify the contents of
!!! /usr/lib/eclipse-3.3, and that such a modification may prevent you from safely
!!! upgrading to later 3.3 revisions.
!!! To ensure correct behavior on your next upgrade, do:
!!! 1) 'emerge unmerge "=eclipse-sdk-3.3"'
!!! 2) 'rm -rf /usr/lib/eclipse-3.3'
!!! 3) 'emerge eclipse-sdk'
|
and the contrary,..how to run kwrite as root without kdesu?
Last edited by GNUtoo on Fri Aug 31, 2007 10:17 pm; edited 1 time in total |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Fri Aug 31, 2007 9:34 pm Post subject: |
|
|
one easy possibility is to put something earlier in root's path that will run some other program named the same thing, possibly in /sbin, or even easier, just create an alias to run 'echo' instead.
I had to do this for 'shutdown' ... I've shut down the incorrect machine multiple times, forces me to check carefully before shutting a machine down. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Rob1n l33t
Joined: 29 Nov 2003 Posts: 714 Location: Cambridge, UK
|
Posted: Fri Aug 31, 2007 9:35 pm Post subject: Re: how to prevent a program to run as root? and the contrat |
|
|
GNUtoo wrote: | sometimes i don't pay attention at the status of the console(if it's root or not) and i run eclipse as root...
how do i prevent it running when i'm root |
The only thing I can think of is to set an alias in root's .bashrc - if this has the same name as the application then it'll get run in preference.
Quote: | and the contrary,..how to run kwrite as root without kdesu? |
You could chmod it as suid I guess. That'll mean anyone can edit anything using kwrite though. |
|
Back to top |
|
|
GNUtoo Veteran
Joined: 05 May 2005 Posts: 1919
|
Posted: Fri Aug 31, 2007 10:16 pm Post subject: |
|
|
i will use .bashrc for eclipse...
and i will also try it for kwtrite(alias kwrite='/usr/kde/3.5/bin/kwrite')
thanks... |
|
Back to top |
|
|
|