0

My goal is to build a LAMP server on my arch linux laptop. The main reason is for a web server. The other reason is to learn about how all this administration stuff works.

My setup is a laptop with Arch Linux. I deleted windows and am using only linux. I have one added user other than root.

My big question: Is it a good idea to make a new user and that user be the server?

2

One way of thinking of users are actual accounts which a person could log into on your server.

But a more common view of users, which you should get used to for administration, is more like a system role.

For example, if you install apache, you will see apache running as 'http' or 'apache' user. That is a legit user on your system, but noone could login as 'http' or 'apache'.

Users should not be thought of as a scary thing. It is okay to have a lot of different users on your system. The real keys to the kingdom are in the root access and the ability to use sudo to access other user accounts.

As long as you keep root locked down and secure, and don't give anyone else sudo access, you can have a lot of users and stay safe.

Just remember files execute as the user who owns that file. So if you have a script in a file owned by root, that script could be very powerful because the commands it runs are carried out as if root were invoking those commands. The file inherits the same privileges, but also the same restrictions, as are held by the user which owns the file.

This is why apache runs as 'apache'. In a way, it protects the rest of the server if 'apache' user ever got compromised. That is just an example, but the general principle applies to the big picture.

1

Technically this question doesn't make sense.

What you want to do is offer people the possibility to connect to your computer and load webpages. For doing that you have to install for example apache as a webserver to give access to the pages. For installing Apache you need to be logged in as a user with root privileges. This user could be the new user(only if it has sudo privileges) or root himself.

For security reasons Apache itself wont run as this user. During installation it will create a new user with a lot less permissions than the average (graphical) user.

The user which has installed apache will (normally) not be part of anything apache does.

Edit: Everything I wrote here about apache is nearly the same for ssh, but ssh does run as root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.