Home > Articles > File sharing Permissions

File sharing Permissions

Q. We have a small graphics department with 4 Macs with external hard drives and no server. We use each other’s files often but we have a problem with permissions. The files are often locked so we can’t open them and save them. It’s very frustrating. How can we get rid of permissions?

A. The problem is that you can’t get rid of permissions. Since MacOS X is Unix, file permissions are at the core of every file. Every file and process on the Mac belongs to a user and a group. Permissions are set up to protect the system from the users and to protect each user’s files.

However, you can get around them or get them to work for you. If you log into the other Macs as “guest” or as a valid user then you can change the permission on a folder (and it’s contents) to be accessible by that user.

Simply stated to change the permissions select the file or folder in the Finder and choose “Get Info” from the “File” menu. Under “Ownership & Permissions” click the triangle to expand and see the Details. You should see the “shortname” of the “Owner”, the “Group” of the owner and “Others”. In order for someone to be able to open (read) and save (write) changes, they either have to be the owner or a member of the group to whom the file belongs.

The easiest way to control a file remotely is to login as the owner. However then you have the same access as the owner – this means you have to be careful. You can create a generic log in to the Mac, such as “macuser” and use the same login on all the Macs – but you would have to do this when you’re setting up the Macs. The installer that sets up the computer doesn’t explain this very well – again to protect the computer…

Another choice you have is to create a second login user on each Mac and then change the permission for the group “staff’ on the folder you want to share. Every user login account on the Mac belongs to the group named “staff”. In order to share a file in the folder, change the permissions for the group to be “staff” and set to “Read and Write”. Also choose “Apply to enclosed items…” to have the permission change all of the files and folders inside – we refer to this as “recursively”. The only drawback is that new file will only be “read only” to staff until you change permissions.

There is also a shareware program called “SharePoints” (www.hornware.com) which emulates the way that a MacOS X sever handles sharing. On a MacOS X Server, you set up folders as “share points” which allow all users in a group to have equal access to the files. This is the same way that MacOS 9 did file sharing as well.

Changing permissions on the command line

Of course, you can also change permissions on the command line. (You have been reading All of my articles – haven’t you?) To change permissions, you have to change a file’s mode using the “chmod” command. To change a file’s owner or group you use the “chown” command.

To begin, open the Terminal app (Applications/Utilities/Terminal). You should then navigate to the folder that contains the file, using the “cd” command. When you open the Terminal you are inside your home folder. (Type “pwd” and Return to see the current or “present working directory”.) You can list the files with “ls” to see the files and folders. Use “ls –la” (that’s list with the options “long” and “all”) to see a long list:

timmitra@TimsG4 [103] ls -la
-rw-r–r– 1 timmitra staff 87444 15 Nov 2005 Configuring.pdf
drwxr-xr-x 141 timmitra staff 4794 7 Jun 16:27 Desktop
drwxr-xr-x 47 timmitra staff 1598 18 Apr 13:16 Documents
-rw-r–r– 1 timmitra staff 3033258 6 Oct 2005 EngStudio 05.pdf
…

The first part shows the permissions (“d” or “-“ means a directory or file)
The “rwx” is read, write or execute for owner, group and others.
Listed next are the Owner’s short name and group.

To change permissions so all can read and write use the command “chmod 755” and then the file or folder name. If you use the recursive option, “chmod –R 755” on a file then all the file’s contents will be made available. (Remember to be careful and you are opening all the files to be accessible.) If you want to make all files inherit the permissions of the folder, you can use “chmod 1755” and the folder (or “chmod g+s foldername”). This turns on the sticky bit and all new files will have the same permissions.

Categories: Articles Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

This site has been visited times since March 2000.