Solved

Mac OS X, change folder attributes

Posted on 2016-09-02
23
26 Views
Last Modified: 2016-10-05
Hi, I have copied a lot of folders in to a shared folder but now need to change the attributes on the folder and sub folders so that everyone on the server has rw access. I have been looking at the chmod command but can't see how to set rw for all users on the Server. OS X El Capitan 10.11.6 , all clients are Macs.

Thanks.
0
Comment
Question by:PeterNairn
  • 10
  • 10
  • 2
23 Comments
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41781517
chmod is quite a simple command

chmod 766 -R /path/to/folder

this will set the folder and all subfiles and folders (-R = recursive) to full read/write permissions

Alternatively on OSX use the Get Info window to edit the permissions on the top level folder.. then click the small gear icon below  and choose the "apply to enclosed items"
0
 
LVL 27

Expert Comment

by:serialband
ID: 41782127
The simpler options for you might be to just add read attributes with +r rather than dealing with the numbers.

chmod +r -R /path/to/folder
0
 

Author Comment

by:PeterNairn
ID: 41784267
Hi, will this give everyone on the server rw access to the first folder and all sub folders ?
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784283
Yes. The -R applies to ALL subfiles and folders
0
 

Author Comment

by:PeterNairn
ID: 41784302
Hi, been trying to set this but tried every path I can think of and still receive -R no such file or directory, do I have to specify the device at the start of the path ? There are 2 HD in the Server.
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784305
Sounds like you've a syntax error in your command
What command are you using?
Any chance you can post it?
You have to use the FULL URL of the folder you want to control ..
if it is a network volume it will be something like

/Volumes/SERVERNAME/path/to/folder

Open in new window

0
 

Author Comment

by:PeterNairn
ID: 41784334
chmod 766 -R /Volumes/tttt_Data/Shared/Data/Scanning

chmod: -R: No such file or directory
server:volumes admin$
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784346
Try this way
chmod -R 766 /Volumes/tttt_Data/Shared/Data/Scanning
0
 

Author Comment

by:PeterNairn
ID: 41784347
the tttt_Data is one of the hard drives that I see when i ls in the volumes directory, the server name is txt Server, I have also tried /volumes/tttt server/tttt_data etc
0
 

Author Comment

by:PeterNairn
ID: 41784348
More like it, now getting Operation not permitted
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784351
OK .. so now you are looking at a different issue.

Operation not permitted indicates that the user account you're using to connect to tttt_Data does not have the permissions to change file/folder permissions.

You can try the follwing command .. which escalates the command to run as the admin user on your PC (however this usually has no impact on network servers as the permissions are controlled on that side)
sudo chmod -R 766 /Volumes/tttt_Data/Shared/Data/Scanning

Open in new window

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:PeterNairn
ID: 41784534
Hi, this has worked but now a lot of users on the Server don't have access to the folders under scanning ?
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784540
Up the permissions to 777 to see does that resolve it

766 gives READ & WRITE permission
777 gives READ & WRITE & EXECUTE .. not sure why your scanning folder might need that but test and see (you can always roll it back if it makes no difference)

You don't indicate what user/role group has ownership of these folders on the shared server
0
 

Author Comment

by:PeterNairn
ID: 41784542
So if I don't Indicate any users should all users get these attributes ?
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784551
766 applies to ALL users

the 7 = read/write/execute
the 6 = read/write

The 3 digits correspond to the 3 different categories of user
owner / owner's group / everyone

If the server is an OSX server then you may also be looking a whole other level of access called ACLs.  What type of server is this and how are the users logging in/authenticating to mount the shared server?
0
 

Author Comment

by:PeterNairn
ID: 41784574
Hi, It's an OS X El Capitan 10.11.6, all users have an account under users, the scanning folder was copied over from another old mac server as a sub folder of a shared folder. We have had user access issues since it was copied over. All users are on Macs. The Issues are only in the scanning folder, all other folders above that are fine.
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784619
Can you check what user and group are assigned on the Scanning folder .. and compare it to the owner:group on other folders which the users can access?

It might be that the owner & group copied from the old server are not 100% valid on the new server
0
 

Author Comment

by:PeterNairn
ID: 41784651
They are assigned on the top folder but not through the sub folders and theres a lot of them, thats why I was hoping to do this with the chmod command rather than going through every individual folder ?
0
 
LVL 39

Expert Comment

by:Eoin OSullivan
ID: 41784657
Can you please clarify?
Are you telling me that on the subfolders inside the scanning folder there are lots of folders with different user:groups owners on each one?
Is it the case that each user is using some software program that is creating a home folder for each user inside the parent scanning folder?

Did you apply the 777 permissions to the Scanning and all subfolders?
After changing permissions .. get one user experiencing problems to UNMOUNT/DISCONNECT the shared server and then re-login and re-authenticate and see if the issue is still there
0
 

Author Comment

by:PeterNairn
ID: 41784662
Hi, yes that is the case. I have restarted the Server and it is still the same :( There is no software being used, just using finder to open files.
0
 
LVL 39

Accepted Solution

by:
Eoin OSullivan earned 250 total points
ID: 41784687
OK .. so in an ALL OSX environment where the Server and Clients are all running OSX the ACL permissions are more important.

You should clear the ACLs on the folders inside the "Scanning" folder
sudo chmod -RN /Volumes/tttt_Data/Shared/Data/Scanning

Once cleared the 766 or 777 permissions should be enough
0
 
LVL 27

Assisted Solution

by:serialband
serialband earned 250 total points
ID: 41785130
You should have done it with the +r option to only add read permissions when you use the recursive -R option.  Bitmask setting is done when you need to set absolute permissions, and that's best done on a set that doesn't mix folders and files.  That way you don't take away the execute bit from the folders with 766 or add the execute bit to the files with 777.  If you've already set it with the bitmask, you've probably messed up your permission structure with the recursion.

How were the folders copied over?  Were they copied with permissions intact or were they dragged and dropped.  You should have run rsync -a to keep all permissions during the copy, assuming it's Mac/Unix permissions you wish to keep.  If the users are on Windows, it would better to use robocopy from the windows side or it may be incomplete.

If the user folders have the wrong owners and have already had updates to them, then you're going to have to run a one-liner script to set them with chown, assuming the folder names match the account names.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Syslogd is a utility that traps and logs messages sent by running processes. It is configured with the syslog.conf file, which consists of lines containing a pair of fields: "the selector field which specifies the types of messages and priorities to…
Information security is a multi-billion dollar industry. Just as lucrative is the black market industry which trades stolen identities, credit card numbers and software exploits all over the world. Nothing is hack-proof. The best one can do is make …
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now