0

I am new to Ubuntu and *nix OSes.

I have just installed the latest stable version of Ubuntu on my computer. During the installation process, I created a user account. Let us call it N1.

Just to try it out, I added a new user account. Let us call it N2. However I noticed that N2 inherited all the applications and the file system of N1.

I would like N2 to have a separate file system with a separate iptables, sources list, etc...(different from N1). And when I make changes to, for example, the iptables of N1, they will not be reflected in N2 (and vice versa).

How do I go about doing it?

2
  • 1
    You know that each user share the same underlying filesystem just that with different permissions right?
    – Braiam
    Mar 15, 2014 at 20:07
  • @Braiam: No, I don't. I don't have a good knowledge of IT.
    – n00b
    Mar 15, 2014 at 20:41

2 Answers 2

4

How do I go about doing it?

You don't. Firewalling (iptables) takes place inside the kernel, as do the port assignments it pertains to. For example, if you want to run a web server on the system using the standard HTTP port (80), then that's what you have. Other computers can connect to yours using that port. There is only one port 80. If another user wants to run a separate web server, he/she will have to use a different port. In this manner, you could apply different restrictions to the different ports using iptables.

By analogy:

I have two people in my car. I notice they are driving on the same street in the same direction together. I would like to have two steering wheels in the car so they can drive on separate streets.

Since we all understand what a car is, we all understand this is a non-sensical desire.

The same logic applies to the root filesystem. There is only one. Different users can have different restrictions placed on them with regard to accessing it. WRT to applications, you can use the per user $PATH variable to control which ones are used by default.

As steeldriver points out, it is possible to run a completely separate operating system inside a virtual machine, on which you could have users unrelated to the ones on your "real" (aka host) OS. This option is a little like setting up a video game console in the back seat of your car so driver #2 can have somewhere different to go.

There are other mechanisms, such as chroot, which can box a user's perspective on the system. However, the normal way to customize a user's environment is to do so by using application specific, per user configurations. For example, you can specify a different desktop environment by adding an .xinitrc in your home directory, so that one user uses GNOME and another KDE. If that file is not present, the user uses the system default.

2
  • Awesome! I love your answer and thanks for taking the time to explain it to me. I have a question though...There are more than 600 employees in the company that I am working for. All of our computers at the workplace are connected to the main server (I don't know what OS the main server is using). How is it that I can customize what software I wish to have on my work computer?
    – n00b
    Mar 15, 2014 at 20:47
  • How that's done at your work I dunno (there various ways, I would think). However, on a standalone desktop, as a particular user you can install software into your home directory and then configure your $PATH to find it. The specifics of that are a separate question, tho (one which has probably already been asked and answered here if you search around).
    – goldilocks
    Mar 15, 2014 at 20:55
2

What you are describing would probably require having a separate virtual machine for each user. Popular virtualization platforms include VirtualBox and VMware Player.

4
  • Of the two, which is more popular, user-friendly and intuitive? I suppose they are open-source applications?
    – n00b
    Mar 15, 2014 at 18:52
  • @n00b VMWare Player is closed-source, I believe. you can do this without a virtual machine with Linux kernel namespaces. I don't know how to do it on an Ubuntu system, but if you were on a systemd system (which Ubuntu is migrating to eventually) you could use systemd-nspawn.
    – strugee
    Mar 15, 2014 at 20:12
  • @strugee: Is Debian using the systemd?
    – n00b
    Mar 15, 2014 at 20:48
  • @n00b no, but they're planning to migrate. when they do, Ubuntu will inherit the changes.
    – strugee
    Mar 15, 2014 at 21:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .