Ubuntu – Using second hdd as storage for all users

14.04hard drivemountpartitioningssd

I have a new build of 14.04. I installed the system on a 128GB SSD and have a 1TB HDD on board as well. This machine will have either two or three users.

Ideally, I would like to use the HDD as storage for the various media files of each user, but where users cannot access one another's stored files. As it sits now it is only accessible to one user.

I'm a bit of an idiot when it comes to drives, but my thinking is that I need to create a separate partition for each user and mount only that partition when a given user logs in. Am I close? And if so, how might I go about doing this?

Best Answer

Nope, you don't have to create a partition for every user, instead you just have to move your old /home to your external HDD.

By default /home is the place for all user files unless "root" though your user files normally will sit here.

For case of permissions by default users can see other files without the ability of changing or modification, if you also want to remove the read permission then easily you can change permission of each user home using chmod command. For example suppose I have a user named test.

$ ls -ld /home/test

drwxr-xr-x 40 test test 4096 Jul  1 14:00 /home/test/

This is the default permissions of user test home and as you can notice it have r-x for others and hence other users can list files in other's home and can read those files.

If you want to prevent users from reading others user's files.

sudo chmod o-rx -R /home/test/ 

Now let's make sure:

$ ls -ld /home/test/

drwxr-x--- 40 test test 4096 Jul  1 14:00 /home/test/

read my asnwer https://askubuntu.com/a/638799/150504 for more information about permissions.

Now how to move old /home to new path(hdd)?

Take a look for my answer here: https://askubuntu.com/a/643445/150504

Related Question