Once logged in to a linux machine, open a Terminal and you’ll issue a few commands. By default, you start in your home directory (/home/username) and it may appear with a prompt to the left of the cursor indicating that (a user’s ‘home’ may be represented by the ‘~’ char).
If you don’t have a directory to share, create one with something like:
[warthogs@lab1-23 ~]$ mkdir TeamSamba
The directory inherits the default permissions, in this case rwx (read-write-execute for the owner, your username; read-execute for group; read-execute for everyone/all users:
[warthogs@lab1-23 ~]$ ls -ld TeamSamba/
drwxr-xr-x 2 warthogs csugrad 4096 Oct 9 12:47 TeamSamba/
To verify the groupname for setting the directory permissions, find out which groups you’re a member of:
[warthogs@lab1-23 ~]$ groups
csugrad telerobotics mediashare src cs6090 cei manu
And assign one to the directory:
[warthogs@lab1-23 ~]$ chgrp telerobotics TeamSamba
[warthogs@lab1-23 ~]$ ls -ld TeamSamba/
drwxr-xr-x 2 warthogs telerobotics 4096 Oct 9 12:47 TeamSamba/
Finally, set the permissions so the group can write files, but no other users can see in the directory:
[warthogs@lab1-23 ~]$ chmod 2770 TeamSamba/
[warthogs@lab1-23 ~]$ ls -ld TeamSamba/
drwxrws— 2 warthogs telerobotics 4096 Oct 9 12:47 TeamSamba/
See ‘man chmod’ or ‘man chgrp’ for syntax details and more information.
Posted in: CADE, Engman Lab, General Tips, Instructor Information, Unix