0

I am pretty much confused about the creation of users!

Because if anyone wants to make a new user he will require my (real id password) when setting their own password using (sudo passwd username)!
But my question is why should I tell them my password? On the other hand, anyone can get access to administration just by adding a simple (sudo group) as its secondary group! So if anyone gets administration access so easily how security is ensured?

Moreover, what is the benefit of changing file permissions because you can do everything in root mode! And all admin users can edit my files which I have denied permission to.

As a beginner, these few questions are puzzling me and I couldn't connect how those Linux concepts are helpful!

Artur Meinild
  • 26,018
  • Welcome to Ask Ubuntu! You have this tagged [tag:windows-subsystem-for-linux], but you don't mention anything about that in the question itself. I can provide an answer in the context of WSL (which is a bit different from "normal" Ubuntu), but I want to make sure that's what you are asking about. Thanks! – NotTheDr01ds Dec 21 '22 at 17:13
  • 1
    WSL is not standard Linux/Ubuntu. It has the same flaw windows has as it is a part of windows. Normal rules do not apply :=) – Rinzwind Dec 21 '22 at 17:26

3 Answers3

3

What is the need of multiple users in linux?

Basically to lower the risk of someone wrecking your system.

Linux caters to ALL users that want to use it. You might not need more than 1 user but others do.

Mind that your complaint is not correct: for a user to become admin that user needs someone that is an admin to grant it. Otherwise that user can never become an admin.

Back in the day Linux was used as a server where a company has 1 or more admins and lots of employees using that machine. That got obsolete sort of. Nowadays we use cloud instances. I maintain 100+ of those and have a dozen co-workers work on them to code software. I do not want any of them to be able to mess with the base system. They can wreck their own software all they want but system alterations are done with a minimum of 2 people plus documentation and adjusting all the other instances.

In a household you can have 1 system where (a) parent(s) owns the machine and sets up accounts for the kids. They can limit their kids activities where those kids can -not- circumvent these restraints. You do not want to need to worry about your kids doing anything you do not want. So for instance downloading movies is limited to a parent and viewing the movie can be done by the kids.

There is 1 big advantage over Windows: due to the security model (as it is (relatively) secure inside the machine already) virus and malware from the outside (/internet) have almost zero impact on Linux. With a virus the idea is to let it loose and have it infect other systems by itself trying to steal data (like mail addresses or login info). That will never happen in Linux (nor in Unix, OpenBSD, FreeBSD) like it does in Windows. People from outside your machine can do almost (it is never 100% safe) no harm to your machine. If you keep to a couple of simple rules: good password, always update and upgrade, don't install software you do not need to run, disable services not required.

Rinzwind
  • 299,756
2

Linux, (and Unix in general), was originally a server operating system. Servers would have one or multiple administrators and several regular users, usually hundreds+, who can connect remotely via terminals like this one:

Only administrators (root user or a member of the wheel group on BSD Unices) can add new users. Each user, regular or administrator, can change their own password via the passwd command and they only need to know their previous password for this. Administrators can also change other users' passwords.

On a desktop system, it would be a bad idea to run every app as root, so usually another user is created. And in order to carry out system administration tasks, this user is given access to sudo to gain administrator privileges. So yes, only administrators can create new users.

a new user he will require my (real id password) when setting their own password using (sudo passwd username)!

No, initially you would set some password for them, once they log in, they can just run passwd and change it without knowing the administrator's password.

On the other hand any one can get access to administration just by adding a simple (sudo group)

This isn't meant to be the case. You'd want to have at least one user who has sudo access, but other regular users shouldn't have it.

what is the benefit of changing file permissions because you can do everything in root mode!

As above, regular users aren't supposed to have sudo privileges and then won't be able to access each others' files.

Hope this helps. Here's a more in-depth introduction. And: more information about commonly used system groups

P Varga
  • 328
1

The security model is from a different time where many people would use the same machine in a shared scenario because they were so expensive. Simple workstations that ran UNIX sometimes would cost $75-192k a piece. If you are talking anything larger than that you would be talking about minicomputers and mainframes, and with those you were talking $200k-MILLIONS per machine. That's in '80's and '90's money, BTW.

So, when you used these machines it was very rare for them to be used only by one user due to the expense. A workstation would often be shared between several people, the mini with a whole large department, and the mainframe with the entire company.

Of course, at this time there was no "sudo" to use... To become root, you had to know and use the root password. Most companies had logging on that was tied into the "su -" command so that they could see who was trying to access it.

In the modern context, the point of it is to run as little of the operating system as necessary in privileged mode and isolate services from one another. So your display manager might start as a "gdm" user who has rights to the video hardware, and your HTTP server might start as an "apache" user or whatever to isolate that service. (and have access to the port 80, etc.) It's much more likely to be used in this manner than to be used for the multi-user setup these days. The reason for doing all that is say you have a security problem with those services they will not have access to the superuser or the user accounts only the folders that are required for that process to run. This isolation makes the average security of a Linux system much safer. Breaking this or that doesn't give you the run of the whole machine. You might manage to break this one service, but the rest of the system is undisturbed.

Generally, with that being said Linux is generally safer by default because you aren't just having to break into the service account, but also the user and the superuser to really hack into a machine. That's why all this is done, and these layers make it barely worth your time to try.

sean
  • 496