script needed for changing permission on data partition

Hi Everyone,

I need a apple script which will change permission on the data partition. Also I would like to execute this script using Apple Remote Desktop.

Thanks,

If you are running this over ARD the easiest way would be to just issue out a unix command since it will run with the authenticated permission set.

The command to change permissions is chmod. You can check the man page for exact usage information since you didn’t specify what type of permission set you are hoping to setup.

Hi James,

I want to give everyone read and write permission on the data partition.

Thanks,

would it be something like this:

chmod a +rw /volumes/data

Thanks,

Pretty much! Although you probably want to do a -R as well to work recursively thru the folder in case anything on the volume has the wrong permissions on it. Also I like to specify paths to the commands so you would send out this…

/bin/chmod -R a+rw /Volumes/data

On a side note I prefer to use the bit version of permissions so I would send the command like so

/bin/chmod -R 777 /Volumes/data

But that’s strictly a personal preference I have.

Hi James,

I went into the lab and ran this command thru ARD and I got error regarding machine was not logged in with any credential. So in order to solve that issue, i have to login into each machine and then Unix command to reset the permissions. Do you know if I have to login to each machine before i can run any command using ARD?

Thanks,

If a machine is logged out when you run the command you can specify the user account to run the command as in the unix window.

manually enter the user and specify the local admin account on the machine that you are targeting. This should be the account used to authenticate to the client when added to a computer list in ARD.

And how can I specify the username in the unix command? It may be a really simple but I am not familiar with Unix commands and have no clue how to run unix command as a different user?

Admin account is same on ARD and the target machines but I don’t know what does ARD uses (credential) once it runs the Unix command remotely on those target machines.

Thanks,

Take a look at the linked screen shot, this is where I am referring to setting the account.

http://thebros.org/pics/ard.png

Does it only work for one task (sending Unix commands)? Can I install packages using local admin account?

And yes, I have test this by sending command using different user without logging into machine and works fine.

Thanks,

Installing a package doesn’t require specifying a user because, generally speaking, the contents of a package don’t modify/add/remove files at the user level, but is generic to the machine.

You could accomplish specific tasks on a user level, if needed, thru the use of scripts - pre/post - flight/install/upgrade