Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shared folder on Linux
  • Add user with home directory: sudo useradd -m username
  • As user, change default shell: chsh -s /bin/bash
  • Set temp. password: sudo passwd username
  • Create group: sudo groupadd groupname
  • Add users: usermod -a -G groupname username
  • Make shared directory: sudo mkdir /home/groupname
  • Set group for shared directory: sudo chgrp groupname /home/groupname
  • Add write access for group: sudo chmod g+w /home/groupname
  • "Set GID" for group (all files created owned by group): sudo chmod 2775 /home/groupname
  • Change to different user to test: su - username
  • Try write access: touch /home/groupname/test.txt
  • Change to different user to test: su - username
  • Try write access: touch /home/groupname/test.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment