I have a processing machine that is running on Linux and is used by many people. This machine has only one user where people using this machine can login and use the machine. What I wanted to do is to create a folder for each person where they can place their data and it will be secured using their email and password for example, so that others will have access to everything except other people private folders. So for example in ~/Documents there will be a folder for each person where only this person can access the content of this folder. Any advice?
You need a separate account for each user. There's no way around this if you want users to be able to have private files.
If you also need a shared documents folder (as well as each users private folder), then create a unix group, add all users to that group, use
chgrp to set the shared directory's group-owner to that group, and
chmod g=rwsX on the directory to enable all group members to read, write, cd into, list files, etc. This
s (sticky bit) in the
g=rwsX chmod mode makes sure that all files and subdirectories created in the shared directory are also owned by that group.
addgroup --group shared # create group called 'shared' addgroup username shared # add username to group 'shared'. repeat for every user mkdir /home/shared chgrp shared /home/shared chmod g=rwsX /home/shared
You can either create a symlink in each users' home directory pointing to
/home/shared (and create one in
/etc/skel too so newly created users get it by default), or just tell everyone to look for shared files in