Users
Add a user
- To add a new user to your system, open a terminal window and type this command in a terminal window, replacing USERNAME with the name of the user:
-
sudo adduser USERNAME
- Answer the questions that come up, giving the user a password, etc. This will create a /home/USERNAME directory for them on the system. Note that the password you assign for the user is only temporary. The user will be required to change the password immediately when he or she logs on for the first time.
Remove a user
- To remove a user from your system, type this command in a terminal window, replacing USERNAME with the name of the user:
-
sudo deluser USERNAME
Check UID of a user
To check the UID (User ID represented by a number), look in the /etc/passwd file.
Assign a password to a user
- To assign a password to a user, type this command in a terminal window, replacing USERNAME with the name of the user:
-
passwd USERNAME
Set Up A Common Folder For Users
By default all users have the ability to create and edit content in their own folders, but cannot alter the content of other users’ folders. If you’d like to create a folder in which more than one user can create and edit content, you’ll need to creat a common folder.
- Open a terminal window on the guest and create a new group called common by typing:
- Modify the user’s account, (-a) appending him or her to that (-G) group by typing this command, replacing USERNAME with the name of the user:
- Create the common directory by typing:
- Set its group to the common group by typing:
- Set its permissions to 777 by typing:
- Set its groupID bit so that files created there will have the properties of the creator’s username and the common group by typing:
- Open the fstab file for editing by typing:
- Add access control list capability to the file system where common is located to control how files created in that directory inherit permissions. To do this, find the line for the drive where common is located. The line will contain ext3 and relatime. Make sure acl is included in the line as in this example:
- When you’re finished, press the Ctrl and o keys at the same time. Press the Enter key to accept the file name it automatically offers. Press the Ctrl and x keys at the same time to exit the editor.
- Reboot the machine to enable the acl setting by typing:
- Open a terminal window and turn on default (-d) rwx modification (-m) for the common group on all files created or modified in that directory by typing:
sudo addgroup common
sudo usermod -a -G common USERNAME
sudo mkdir common
sudo chgrp -R common common
sudo chmod -R 777 common
sudo chmod g+s common
sudo nano /etc/fstab
/ ext3 acl,relatime
sudo reboot
sudo setfacl -d -m group:common:rwx common
Test The Common Folder
To test the common folder to be sure it’s set up properly:
- Open a terminal window.
- Change to the common directory by typing this command, replacing the path in this example with the path to the common folder you created:
- Create a test file by typing:
- Edit the new file by typing:
- Add a line of text and save the file.
- Save the file by pressing the Ctrl and o keys at the same time and then pressing the Enter key to accept the file name.
- Exit the editor by pressing the Ctrl and x keys at the same time.
- Change to a user who has access to the common folder by typing this command, replacing USERNAME with the name of the user:
- Provide the user’s password. If this is unknown, you will either need the user to test the access for you or you can use the instructions above to create a new user and give that user access to common, deleting the user when finished with the test.
- While logged in as the other user, type:
- Change the line of text in the file or add a new line to the file.
- Save the file by pressing the Ctrl and o keys at the same time and then pressing the Enter key to accept the file name.
- Exit the editor by pressing the Ctrl and x keys at the same time.
- Change back to your username by typing this command, replacing USERNAME with your username:
- View the text file by typing:
cd /home/common
touch test.txt
nano test.txt
su USERNAME
nano test.txt
You should see the line of text you originally typed into the file.
su USERNAME
cat test.txt
You should see the changes you made to the file. If you don’t, go back through all the steps to make sure you did them properly.
Obligatory Happy Ending
And they all lived happily ever after. The end.

Comment: