- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
08-24-2018
02:23 PM
- last edited on
03-04-2025
07:41 AM
by
kh-richa_mig
I want to run a script on a Mac that is initiated by an item in Self Service.
Our user accounts are AD based, "Managed" and "Mobile" according to Users & Groups.
The script is going to create a folder on the user's desktop and then copy some log files to the folder.
I want the user to be be able to review the contents of the folder but, as created by the script, the user does not have permission to do so.
So: after the folder is created and populated, how do I chmod the folder so that it belongs to the user account? I'm able to get the userID and set it as the folder owner, but I have no idea what group to assign. Just changing the owner of the folder doesn't appear to give the user access to it. I'm doing something wrong, I just can't figure out what that is.
Can anyone offer some direction?
Solved! Go to Solution.
- Labels:
-
Scripts
-
Self Service

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-24-2018 02:32 PM
This should do it:
#!/bin/bash
userName=""
folder="/Users/$userName/Desktop/FolderName"
chown -R "$userName" "$folderName"
exit 0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-24-2018 02:32 PM
This should do it:
#!/bin/bash
userName=""
folder="/Users/$userName/Desktop/FolderName"
chown -R "$userName" "$folderName"
exit 0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-24-2018 02:34 PM
If that does not work you can throw this at the end:
chmod 700 "$folderName"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 08-24-2018 03:01 PM
@ryan.ball thank you! It was the -R on the chown that did the trick!
