Showing posts with label permissions. Show all posts
Showing posts with label permissions. Show all posts

Monday, 6 October 2014

Apple Remote Desktop ARD preferences and presets transfer

It's always good to have a backup of all the preferences and tasks you have saved in ARD. I thought I had it sussed,  just need the file:

~/Library/Prefeences/com.apple.remotedesktop.plist

Turns out as of version 3.7 it's all been 'sandbox'ed. That means these prefences files have been moved to:
~/Library/Container/com.apple.remotedesktop/Library/Preferences/com.apple.remotedesktop.plist

But not only this, it has to have the right ACL's (permissions)

What I tried to do is copy this file between accounts and it ended up replacing the copied file with a blank one every time. It wasn't until I read this post which mentioned resetting ACL's. THis is the command they suggested using:

{ sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:staff ~ $_ ; sudo chmod -R u+rwX ~ $_ ; chmod -R -N ~ $_ ; } 2> /dev/null
So first I copied the com.apple.remotedesktop.plist file to  
~/Library/Container/com.apple.remotedesktop/Library/Preferences/com.apple.remotedesktop.plist

I then ran the command in terminal.

Then I logged out and back in again.

Crash bang wollop it worked.

Cheers

Wednesday, 10 September 2014

Mavericks "The software for the printer was installed incorrectly" error

After reimaging a computer suite with Mavericks and installing a networked printer via "Profile Manager" mobileconfig files, the printer had an exclamation mark next to it in the print dialogue box. When a print was sent to the queue, the print queue would load up and prompt the error:

"The software for the printer was installed incorrectly.
Would you like it to be repaired?"

After clicking "Repair" you are prompted with an Administrator Username and Password dialogue box.

I needed to find a way of "repairing" all these machines via ARD or Profile Manager. Looking in console, I found that the error was due to:
"/Library/Printers/hp/filter/hpPostProcessing.bundle/Contents/MacOS/hpPostProcessing" has insecure permissions (0100775/uid=0/gid=80)"

I found this forum which mentions the fix which is to change owner and permissions.

I ran a few commands to first change the owner, which needs to be Wheel, and the permissions with need to be 755. After doing so, I needed to reboot to see if it had fixed it, only to come up with more errors due to insecure permissions of the containing folders. After continuously doing this it finally fixed it.

I ended up running a command which changed the permissions for the whole /Library/Printers folder recursively:

chmod -R g-w /Library/Printers/
chown -R root:wheel /Library/Printers/

This needs to be run as root, which is an option in ARD, or you can put "sudo" before each line.

Sunday, 30 March 2014

Drupal Backup and Migrate private folder settings

So, I'm just getting started with Drupal and just installed the Backup and Migrate module. When I tried a backup to a folder on the same server it came up with an error. It was basically saying that this folder was not private and anyone can access it.

Thought I'd take a quick look into it. Turns out that the folder in question - sites/default/files/private/backup_migrate/manual/
can be read by anyone, therefore files are not safe.

So, how do you make it 'private'. Well, a good test is to try and navigate to the file:
sites/default/files/private/backup_migrate/manual/test.txt
which automatically gets made. I typed it into a browser and it loaded up. Simple.

So, to limit access depends on you hosting provider. I'm with Daily.co.uk, and they suggest using .htaccess files. I found this nice article on the subject, worth reading through properly.

I found that this command at the top of the .htaccess file (which was already in the folder) solved the problem:

AllowOverride All

I figure it's telling the Apache server to override all options.

Monday, 10 March 2014

OS X Mavericks and Active Directory Home drive problems (NHR)

So, I'm going to document what problems I currently have with Active Directory home drives stored on windows SMB shares.

In the past when we put our macs on the active directory logins, I always untick the "Force local home" in the active directory options. The main reason is so that users take with them all of their account settings and preferences where-ever they login. This does however come with problems. It seems the mounted home drive has some permission issues which some applications have real problems with.

In the past I have installed Network Home Redirection (NHR). At login, this script runs whenever it detects the user to be a network user. It then creates a local temporary folder and creates alias' from particular folders on your home drive to the local folder. From the perspective of an application running, it thinks that these folders are normal local folders which they tend to prefer.

The default NHR setup redirects folders of known problems in OS X 10.6. But I don't think it is updated anymore. I have been constantly adding and taking away folder re-directions for the application we use in the computer suites.

Here I shall document current problems with network home preferences where NHR has worked.

Adobe Acrobat Pro 9
Seems to Crash when opening a document
Redirected folder: ~/Library/Application\ Support/Adobe/Acrobat
Seems to have fixed the crash

Wednesday, 16 October 2013

Problems with Administrator login for 10.7 imaged macs

In the computer suites with 10.7 image machines I'm having a problem with the administrator account. When I login as the local administrator UID 501 I have no access to any of this users home folders, inluding the ~/Library folder. Having a look at the permissions shows that administrator is the owner with read-write permissions. Typing in the command:
sudo chown -R $USER ~$USER

Comes up with:
Folder does not exist

but typing in:
sudo chown -R $USER ~/Users/administrator


Administrators-iMac-49:~ administrator$ id -u $USER
501
Administrators-iMac-49:~ administrator$ ls -Al
total 64
-rw-------   1 administrator  staff      3  5 Jul  2012 .CFUserTextEncoding
-rw-r--r--@  1 administrator  staff  12292 10 Jul  2012 .DS_Store
drwxr-xr-x   4 administrator  staff    136  6 Jul  2012 .adobe
-rw-------   1 administrator  staff   3357 12 Jul  2012 .bash_history
-rwxrwxrwx@  1 administrator  staff     30  6 Jul  2012 .fgufohsrc
-rw-r--r--@  1 administrator  staff     17  6 Jul  2012 .sewtzsfn
drwxr-xr-x   2 administrator  staff     68  6 Jul  2012 Applications
drwx------+  5 administrator  staff    170 15 Oct 15:40 Desktop
drwx------+  7 administrator  staff    238  9 Jul  2012 Documents
drwx------+  6 administrator  staff    204 10 Jul  2012 Downloads
drwx------+ 39 administrator  staff   1326  9 Jul  2012 Library
drwx------+  3 administrator  staff    102  5 Jul  2012 Movies
drwx------+  4 administrator  staff    136  9 Jul  2012 Music
drwx------+  5 administrator  staff    170  6 Jul  2012 Pictures
drwxr-xr-x+  5 administrator  staff    170  5 Jul  2012 Public
lrwxr-xr-x   1 administrator  staff     63 12 Jul  2012 Send Registration -> /Users/administrator/Library/Assistants/Send Registration.setup
Administrators-iMac-49:~ administrator$ sudo chown -R $USER ~
Password:
Administrators-iMac-49:~ administrator$ ls -Al
total 64
-rw-------   1 administrator  staff      3  5 Jul  2012 .CFUserTextEncoding
-rw-r--r--@  1 administrator  staff  12292 10 Jul  2012 .DS_Store
drwxr-xr-x   4 administrator  staff    136  6 Jul  2012 .adobe
-rw-------   1 administrator  staff   3357 12 Jul  2012 .bash_history
-rwxrwxrwx@  1 administrator  staff     30  6 Jul  2012 .fgufohsrc
-rw-r--r--@  1 administrator  staff     17  6 Jul  2012 .sewtzsfn
drwxr-xr-x   2 administrator  staff     68  6 Jul  2012 Applications
drwx------+  5 administrator  staff    170 15 Oct 15:40 Desktop
drwx------+  7 administrator  staff    238  9 Jul  2012 Documents
drwx------+  6 administrator  staff    204 10 Jul  2012 Downloads
drwx------@ 39 administrator  staff   1326  9 Jul  2012 Library
drwx------+  3 administrator  staff    102  5 Jul  2012 Movies
drwx------+  4 administrator  staff    136  9 Jul  2012 Music
drwx------+  5 administrator  staff    170  6 Jul  2012 Pictures
drwxr-xr-x+  5 administrator  staff    170  5 Jul  2012 Public
lrwxr-xr-x   1 administrator  staff     63 12 Jul  2012 Send Registration -> /Users/administrator/Library/Assistants/Send Registration.setup


fixes the problem. Logging out and back in again randomly recreates the problem. It's as though there are two administrators with different UID's and it's random which one it logs in with. There is the possibility that there is a networked account. Next I shall switch off networked accounts and log in.

Just used the ls command which lists the UID instead of username:
ls -n
total 8
drwxr-xr-x   2 1414341556  20    68  6 Jul  2012 Applications
drwx------+  5 1414341556  20   170 15 Oct 15:40 Desktop
drwx------+  7 1414341556  20   238  9 Jul  2012 Documents
drwx------+  6 1414341556  20   204 10 Jul  2012 Downloads
drwx------+ 39 1414341556  20  1326  9 Jul  2012 Library
drwx------+  3 1414341556  20   102  5 Jul  2012 Movies
drwx------+  4 1414341556  20   136  9 Jul  2012 Music
drwx------+  5 1414341556  20   170  6 Jul  2012 Pictures
drwxr-xr-x+  5 1414341556  20   170  5 Jul  2012 Public
lrwxr-xr-x   1 1414341556  20    63 12 Jul  2012 Send Registration -> /Users/administrator/Library/Assistants/Send Registration.setup
Administrators-iMac-75:~ administrator$

Sorted, it simply thinks that there is an administrator account with UID 1414341556


Administrators-iMac-75:~ administrator$ id -u $USER
501
Administrators-iMac-75:~ administrator$

I have now run the command:
chown -R 501 /Users/administrator

I have yet to find a re-occurrence.

------------------- march 2014

well, I found a re-occurrence. I ended up renaming the administrator account to:

administratorb

Cheers

Tuesday, 27 November 2012

Photoshop could not save because of a disk error

Well, quite recently students have been having trouble saving from Photoshop CS5 version 12.0.

It comes up with:
It's strange because if you try multiple times, sometimes it saves and others it comes up with the error.
Could not save as because of a desk error.

Looking in the console log I found these entries:

26/11/2012 16:09:36 /Applications/Adobe Photoshop CS5/Adobe Photoshop CS5.app/Contents/MacOS/Adobe Photoshop CS5[1697] Allocator race detected: transaction is not verified for -103/2 - _mac_bind/Library/Preferences/Adobe/Color/ACEConfigCache2.lst
26/11/2012 16:09:48 /System/Library/CoreServices/Dock.app/Contents/MacOS/Dock[1652] Allocator race detected: transaction is not verified for -103/248 - Untitled-4.psd
26/11/2012 16:09:49 kernel smb_maperr32: no direct map for 32 bit server error (0xc0000279)
26/11/2012 16:09:49 kernel smb_maperr32: no direct map for 32 bit server error (0xc0000279)

It seems to be a problem with users whose home drive is on Windows 2003 or before shares. Luckily I have my home drive on a Windows 2008 share.

Looking on the internet for the kernel error I found this down in the "Mac OS X bug: Empty oflders when browsing Samba shares on Windows 2003 Server". He gets the error when looking in sub-folders on a Windows 2003 server. Might be related.

Tried it with my login with my home drive on Windows Server 2008 share and works without problems.

So far I've tried:

  • OS X 10.7.4
  • OS X 10.6.6
  • OS X 10.6.8
  • Photoshop CS5 12.0.4
  • Redirecting ~/Library/Application Support/Adobe/ to a local folder
Just had a very similar problem with Windows PC's. Students trying to save from Photoshop to their home drive came up with a similar error:
Could not save as because the file could not be found
It looks like it's a server problem as it happens on both Windows and Mac. I shall update when I find out more.

Friday, 30 September 2011

Making a pkg file for installing sendLogon for Bloxx on OS X

In a previous post I described how we're getting a new web filtering system called Bloxx, which needs the sendLogon program to be installed and run as a login script on all the Apple Macs (OS X).

I used Iceberg free application to make the PKG file as I've used it before with relative ease, and also couldn't find the latest official Apple PKG maker app!!

Its all working now so here's how I did it:
  1. Made a new project in Iceburg, and made a nice little folder to hold all the files needed (makes it easier to find things)
  2. I filled in the top section "Settings"
  3. Next was the "Scripts" section. I had to make a script which changed the com.apple.loginwindow plist file to add the LoginHook /usr/bin/login.sh
    1. I ran nano from the command line (nano ~Desktop/sendLogonfiles/Install\ sendLogon/writeloginhook.sh)
       and typed:
    2.  #!/bin/tcsh
      sudo defaults write com.apple.loginwindow LoginHook /usr/bin/login.sh
    3. I found I had to put "sudo" into the script so that it had the right permissions to write to the file. Not sure why else it didn't work?
    4. I saved the file and made the file executable - chmod 755 ~Desktop/sendLogonfiles/Install\ sendLogon/writeloginhook.sh
  4. I then added this script to the "PostFlight" script, and set the path to "Relative". Note - I found an article here documenting the definition of each of these types of scripts. Most were concerned with whether this was an upgrade or not, and would only run once.
  5. Finally was the "Files" section. 
    1. I firstly put the files in the project folder.
    2. I set these files with the correct permissions (as in the tutorial folder for sendLogon). chmod 755
    3. Then, in Iceberg, I had to add the folders; /usr/ and /usr/bin/, which were not there.
    4. I then made the "Default Destination" the /usr/bin/ folder
    5. Finally I added the login.sh file and the sendLogon file.
I've just tested this through the Apple Remote Desktop Task Server on a single MacBook Pro and worked a charm (had to ring ICT though to add its' IP address to the Bloxx list of computers with sendLogon working)

Note: There is potential also for adding to this a little script which changes the proxy settings to the system and maybe also Firefox, but it would be easier to control these settings through a .pac file or .wpad file.

Tuesday, 20 September 2011

Making a pkg file to distribute through ARD Task Server


After making my little "Fix Everything Please" Automator Application I wanted to distribute it to all the machines, and the easiest way of doing this is using the much unused Task Server I have set up through Apple Remote Desktop. I have done this process before, but not documented it very well. What's worse is that I cannot find the newest "PackageMaker" application since re-imaging my machine, only the one which comes with Remote Desktop, which was originally for OS X 10.4! Apparently you can download it with the newest iPhone SDK which comes with XCode.

So, after some looking I found a well reviewed Package Maker app called Iceburg. Downloaded it, installed it and rebooted. Apparently it's a lot simpler then PackageMaker and I'd made the package in about 3 minutes. This is how I did it:

  1. Make a "New Project"
  2. Fill in the "Settings" section:
  3. Settings section of Iceburg Package Maker
    1. I put Admin Authorisation so there would be some control
  4. Fill in the Files section at the bottom:
    1. I clicked on Applications and pressed the "Set" button to set this as the Directory it was going
    2. Files section of Iceburg Package Maker
    3. I right clicked on the Applications folder and chose "Add Files..." and chose "Fix Everything Please.app" (I made sure the permissions were right in Finder before I did this)
  5. Clicked "Build and Run" in the top menus
Worked a charm. I had a little trouble getting the permissions right. At first it would make it "Read Write" for "Everyone". I changed the permissions and then re-added it to Iceburg and it seemed to work.

Thursday, 1 September 2011

Setting Ignore ownership on this volume from Command Line ARD

I have a lot of computers, all with a separate volume for storage of files, mostly for Video editing storage. After re-imaging them all I need to set the other volume, which is named "Scratch Disk" so that it does not have any permissions, as it causes issues when groups of students use the same files.

This is a little tick box in the 'Get Info' box for that volume in the Finder. But to do it on all these macs would not be economical with my time. So the best thing to do would be to find the command line argument for it, and use Apple Remote Desktop (ARD) to send this command to all the computers.

After a quick search I found this article by apple explaining how to do the opposite; "do not ignore ownership on this volume". To do this the code was:


sudo vsdbutil -a /Volumes/NewHD/
I did a quick man on this "vsdbutil" and found the argument I was looking for -d. So the actual line to use is:
sudo vsdbutil -d /Volumes/Scratch\ Disk/
notice the "\" character just after the word "Scratch", which denotes that there is a space after it. Of course I run the command line as a root user so no need to have the "sudo" at the front.