-----Original Message----- From: Jerry Feldman [mailto:gaf@blu.org] Sent: Tuesday, September 13, 2005 3:43 PM To: suse-linux-e@suse.com Subject: Re: [SLE] Running a program as root?
On Tuesday 13 September 2005 3:35 pm, Jay Paulson wrote:
Hopefully this is an easy question.
I need to run a program as root user in the KDE GUI Desktop. I'm currently logged in as a local user. Is there a way to run a single program as the root use when logged in as a local user? This way
the
program will have all the permissions it needs in order to do it's job.
There are a few ways of doing that. Some will automagically ask you for the root password and then run. You can also use sudoers. Another method is to simply su- or sux - to root and run from there.
I got it working. However, let me tell you what I did to make sure this is correct and secure. I just opened a terminal and su'ed to root. Then I went to the directory the application is in that I wanted to run and I executed the command. Poof that application is now running as root. :) This is one way to do it. As James alluded to there is a program called sudo(1). Sudo uses a file, /etc/sudoers, that allows various users to use sudo. Sudo is very useful for running a quick program: sudo foo In this case, foo will run as root.
As a general thing, get in the habit of using sudo for everything -- ideally, you shouldn't ever have to log in as root.... It's just good security practice.