How to change a process running in root-user to non-root user ????????????????????
Is It possible to change a process running in root-user to non-root-user by setting suid / uid / euid / gid etc...
I so please instruct how, when and wat to set in order to change a process running in root-user to non-root user ?
Thanks in Advance
you can't *change* the owner, but you can start it running as whoever you want during a boot up. If there is no automatic handling of this via the program itself (many programs will pull levers internally to become unpriviledged users once they no longer needs roots powers) then you can run a command via su, e.g. "su -l myotheruser -c runthiscommand" in your /etc/rc.local script for example.
My daemon is in "/etc/init.d/"
For verfication purpose
I run your command "su -l myotheruser -c runthiscommand". manually as a root-user shown below.
[root@lin4 storage]# su -l test -c "chroot /home/test/builds/server/schroot /apache/bin/httpd -k start"
I faced this error
chroot: cannot change root directory to /home/test/builds/server/schroot: Operation not permitted
wheather I need to run the command as a non-root user ????
for your reference
ls -l /home/test/builds/server/
drwxrwxrwx 12 test test 4096 2009-10-27 20:34 schroot
if i run directly chroot as a root-user, then it is working
as shown below
[root@lin4 storage]# chroot /home/test/builds/server/schroot /apache/bin/httpd -k start
For your reference
[root@lin4 Storage]# ps aux |grep httpd
root 28251 0.8 0.3 17072 6744 ? Ss 14:58 0:00 /apache/bin/httpd -k start
Well apache is really not a good example for using this, esp wil chroot. httpd will normally run as a different user, e.g. web or httpd or nobody, so there's no need to externally fudge something like this, in the same way there are proper ways to chroot it too.
|All times are GMT -5. The time now is 11:44 AM.|