Click to See Complete Forum and Search --> : "Run as" ?? (very basic question)


Ethan
06-15-2001, 04:00 AM
In reading manuals I've found advice like, "...you should have MySQL run as the same user every time..." What does "run as" mean in this context? The concept had no meaning in MacOSs 9 and lower. Is it that when you you launch an application in Linux, it isn't just running, it's running as some user? What does that mean in practical terms? Should I set up different users for different apps? If I'm logged in as one user, can I launch an app and have it run as a different user?

I seek wisdom.

Thank you.

Ethan

Dark Ninja
06-15-2001, 04:05 AM
When you run a program as a user, that user is the one who has control over that program. In theory, you should have at least two users on your computer (besides the default users, which are required in most cases). You should have root and another user. It is not a good idea to run a lot through root, as a simple command could easily take out your system.

You CAN run other programs through different users by using the 'su' command. For exmaple, if I'm logged in as 'dninja' and I need to run a command under root, I type:

$su root

and then I am asked for the password. Type in the password, and I'm not running as root.


Dark Ninja

Craig McPherson
06-15-2001, 04:10 AM
You can use su non-interactively, also:

su root apache-ctl start

That'll run the "apache-ctl" program as root. Remember, anything run as root has full access to use, abuse, or destroy anything on the system.

A non-root user will have to supply the root password to su to root. For that matter, a non-root password su'ing to any other user will have to know that user's password.

Root, however, can su to any user's account without a password, since root has full control of the system. On one system I administer, I like to su to the account of this girl I like and send love letters to myself.

Su also has many uses that aren't psychologically unhealthy.

posterboy
06-15-2001, 07:15 AM
Perhaps interesting, is ps -aux. Look at "who" the users are that are running all that stuff on your system. It's people you don't even know! :) Ray