Sharing Folders
- The Goal of this tutorial is to show you how to create and share a folder with other SECS account holders. This is ideal for collaborative work, such as allowing a partner to access your files, or allowing your professor to view your code.
You can share your folder in multiple ways. This tutorial will cover sharing the folder from Windows Explorer through a mounted Network Drive, as well as using the Linux command line (which you can access over ssh or through the NX client software.)
Windows
Editing Permissions
- Open up your Network Drive (H: drive in lab machines)
- Right click on the folder you would like to share, and click "Properties"
- Select the Security Tab
- Click edit (if in Windows Vista)
- Click add
- Type the SECS user name you wish to grant access to. if more than one use ; as a delimiter. Click OK. The added user will show up in the list of user names.
- Select the user name you just added
- Click the allow check box to give the appropriate permissions. Full control selects them all
- Click OK, (In vista, click OK again)
- Your folder is now shareable, to gain access to a shared folder use the "Create a Shortcut to a Shared folder" instructions below.
Create a Shortcut to a Shared folder
- Open your Home directory
- right click, New, Shortcut
- type \\dione.secs.oakland.edu\SECSunix\home\First letter of Hosts User name\Hosts User name\Shared Folder\
for example if the folder name was vistaFan and the folder was created in the home directory of user name stevejobs. then you would type \\dione.secs.oakland.edu\SECSunix\home\s\stevejobs\vistaFan\
If you prefer the command line, or don't have a Windows machine available, you can ssh or NX into any one of the Linux Servers (for instance, login.secs.oakland.edu or www.secs.oakland.edu.)
From the command line, type the following two commands:
$ setfacl -R -d -m user:<username>:rwx path/to/shared/folder
$ setfacl -R -m user:<username>:rwx path/to/shared/folder
Where <username> is the username of the student you'd like to share the folder with, and path/to/shared/folder is the path to the folder you'd like to share.
For instance, if you'd like to share your public_html folder (which contains your SECS web site) to user simon23, you can type:
$ setfacl -R -d -m user:simon23:rwx ~/public_html
$ setfacl -R -m user:simon23:rwx ~/public_html
Setting advanced permissions in Linux
The above commands give read, write, and execute permissions for the specified folder, and all its subfolders. If you'd like to only give read access, replace the "rwx" with just "rx" in the above commands.
The two commands above do two things. The second command actually modifies the permissions. The first sets the "default" access control list on the specified folder and subfolders. This means that any new files created in that folder will have the new permission you are setting. (In the second case, any new file you create in public_html will be readable and writable by simon23, even if you don't explicitly change it in the future.) If you don't want to do this, you may omit the first command.
If you want to give a user access to a particular folder, but not its subfolders, omit the -R flag from the above commands.
If you only want a user to view a specific file, and not a whole folder, enter the path to that file instead of a path to the whole folder. (Or folder_name/* for all the files within a folder.)