Disk image can mount from local terminal with "open" command but not via ssh

I have a disk image "backup_image.sparsebundle". If I go to the terminal on my machine and type "open backup_image.sparsebundle" the disk image mounts as expected. No problems. If I secure shell (ssh) log in from a remote Mac and execute the same "open backup_image.sparsebundle" a warning dialog pops up and states that "The following disk images couldn't be opened" followed by my disk name. This is incredibly odd because it used to work just fine. I didn't think there were any ACL differences between a local terminal shell and remote ssh. I mean a shell is a shell right? Or, it used to be and now it isn't? I'm not doing anything obviously incorrect (to me); I'm the same user locally and remotely, same path to disk image. This used to work fine before Mountain Lion.
Background: All of this started because I wrote a script that would ssh in to a remote machine, open the disk image on that remote machine, mount it across the network over afp and rsync. If I leave the disk image mounted on the remote machine, the script runs fine but if the image is close and I try to remotely open the image as I always did, it fails. The only thing that has changed in the system is, now, both machines are running Mountain Lion. Odd.
Suggestions?

Storing the password for the remote disk image in the local keychain of the computer running the script (in to a variable), then passing it accross to the remote machine worked. I'm not sure why all of this changed moving from Lion to Mountain Lion but I suppose it is slightly more secure.
To programatically mount and sync a remote encrypted disk:
#!/bin/bash
if [ -n "`mount | grep ~/sync`" ]; then
  echo "Already mounted"
else
  pw=$(security -v find-generic-password -w -D "application password")
  ssh -o ConnectTimeout=1 [email protected] "echo $pw | hdiutil attach /Users/user/backup_image.sparsebundle"
  mkdir ~/sync
  mount_afp -s "afp://matdup01:[email protected]/Disk Image" ~/sync
fi
if [ $? -eq 0 ]; then
  echo "Mount succeeded!"
else
  echo "Mount Failed"
  exit 0
fi
rsync -vrxtu --delete-before --exclude _* "/Volumes/Media/new Media/" ~/sync/new\ media/
umount ~/sync
rmdir ~/sync
exit

Similar Messages

  • I just installed Airport Extreme.  I can connect to the internet with a cable but not via wireless.

    Can't connect to my new Airport Extreme via wireless, must have laptop plugged in with cable.
    Apple ipad and iphone are connected with no issues.

    Figured it out by going to Start--> Connect To...

  • HT4356 I can print from other applications on my iPad but not from Dropbox

    I can print from my iPad using other applications but not Dropbox

    Is your printer one of the models listed here: http://support.apple.com/kb/HT4356

  • I can conect from my iPad to my Mac, but not from my Mac to my iPad whats up with that

    I can connect face Time from my iPad to my Mac, but not from my Mac to my iPad

    Register/Sync with iCloud on both your iOS devices and your Mac.
    Peter

  • Contents of disk-image lost (mounted from iDisk)

    I've stored an encrypted disk-image on my iDisk and mounted it directly from the network-drive by double-clicking the sparseimage-file. Then I worked directly with the files on that mounted volume. I neither copied the disk-image nor any of the files to a local drive.
    Suddenly my MacBook Pro freezed and I have to reboot it. When I mounted the disk-image again, I discovered, that nothing of my work has been saved. I've created a lot of new files and regularily saved changes by storing them on the mounted volume. But it seems, that this changes have never been transferred to my iDisk. Two days of work got lost!
    My question: is there any local copy of a mounted disk-image, where I can recover the lost files?
    At what time an encrypted disk-image got synced? Only when dismounting it?
    I'm very disappointed if mounted network-drives are that unsecure and fragile.
    Thanks for any help,
    makeCents

    I'm thinking it would only be saved on closing/dismounting it., local Disk Images would be that way too.
    I can't believe virtual disks work that way. The documentation of disk-images tells that you can open, read, and write files on disk-images like on normal drives. Writing should be a transaction, that means the data should be securely saved or an error message has to be raised if not.
    It can't be, that a successful write transaction isn't really stored. Even on network drives this has to be secured. That's basic operating system stuff.

  • Mac 10.6.3 with Firefox 4.0.1: Can print from Word, PDF, Screen Shots, etc.--but not a web page. My Canon MP610 shows correctly as default printer.

    If I use AOL's browser, I can print Web pages. But not from Firefox. Could be this problem began with upgrade to your 4.0.1.

    If I use AOL's browser, I can print Web pages. But not from Firefox. Could be this problem began with upgrade to your 4.0.1.

  • I can stream from ios to new airport express but not from windows 7 or powermac G5

    I have new airport express and older apple tv on my network.  Both are connected and found by all devices - Windows 7 laptop, Powermac G5 and all ios devices.  I can stream music via airplay to both airport express and apple tv from ios devices (one at a time of course).  I can stream from itunes to Apple TV but cannot connect to the airport express!  It shows up and I get the dredded error: An error occured while trying to connect...
    I tried some of the many ipv6 suggestions that I've seen here but nothing is working. 
    Anyone have the setup?  Is this an airport express setup issue?  Please help!!!

    OK, I'm tipping my hat to Apple's (new) online experts. Great job.
    They might be able to solve YOUR problem, too. Find them at:
    http://www.apple.com/support/expert/

  • File open menu will not open local files using open command but the same files will open if I double click them (permissions seem fine)

    Under File menu Open File will not open local files even those downloaded to the desktop by Firefox 5.
    If I double click on HTML file it does open
    Reinstalled. Same behaviour. Default Browser set correctly.
    Permissions set correctly. Odd behaviour.

    Are you sure it hasn't imported?
    Check for the track names (trackname only, not Album or Artist)) and see if they have a blank Artist and Album, because WAV files have no MetaData, so are kind of stupid as far as knowing anything about the Artist, Album & track id.
    You can't search by 'Untitled' either as there is literally, no name at all, but iTunes does pick up the actual physical track name in Finder and uses that. As an example, if you renamed your Aerosmith WAV file from say 'Toys In The Attic' to 'Love Song' it would import the track as 'Love Song' as that's all it can go by.
    There are a few iTunes AppleScripts that let you import from a file of WAV music, by looking at the enclosing Album in the enclosing Artist as that's how most PC progs create the WAV file structure.
    Mike

  • I can see my wi-fi with windows computer, but NOT with any of my apple devices

    I cannot see my wi-fi with any Apple device, but AM able to use my non-Apple comupter

    That is a reversal of note.. normally people are struggling to get their windoze boxes to work.
    Reset the Airport to factory and start over.
    Use all short names, no spaces and pure alphanumeric.
    Leave off the wireless security until you confirm it works... then add wpa2 personal security with a 10-20 character pure alphanumeric password.
    You can also try fixing wireless channels.. test 11, 6, 1 for 2.4ghz in that order.

  • Encrypted disk image sometimes mounts without password

    I have an encrypted sparsebundle disk image containing sensitive information.  On occasion (maybe one time out of ten), I'm able to mount it without being prompted for the password.
    The password for the image is not stored in my keychain.  Can anyone offer advice on this issue?

    I was having exactly this same problem!
    I keep a small encrypted disk image storing sensitive banking information. I do NOT have the option to store passwords in Keychain checked, and I verified that the password is not being stored in Keychain.
    Yet, when I double-clicked the supposedly encrypted sparsebundle disk image, it opened right up and mounted - no password required! Unbelievable, right? So I started to investigate.
    I first noticed this behaviour in Mountain Lion, I'm running 10.8.4 on a 2.7 GHz 15" MBPr.
    In past versions of OS X I would mount the volume to work on it by double-clicking on the disk image, enter my passowrd, and then Eject the volume either by dragging to the trash or clicking the Eject button on the Sidebar. The next time I would try to access the disk image by double-clicking it, it would again prompt for a password. All good.
    What seems to be happening in ML is, using the same workflow, even though the volume is disappearing from Finder, the disk image is not actually being unmounted!
    When I go to Disk Utility, the disk image is still mounted, but the volume is grayed out. When I Eject the disk image in Disk Utility, it then reverts to the expected bahaviour, and double-clicking on the disk prompts for a password.
    So the workaround seems to be when finished working on the volume, go to Disk Utility and manually Eject the disk image (as opposed to just the volume it mounts) to ensure it has unmounted and is thus again encrypted. The reason for it sometimes requiring a password, sometimes not is probably because after a restart of the computer it would unmount all disks, and then be unable to re-mount it until the password is entered. But in between, unless you were aware of this behaviour anyone with access to the disk image can view its contents.
    What a terrible security flaw IMO, as there is no visual indication in Finder that the disk image is still unprotected after you unmount its volume and that icon disappears! I'm surprised this hasn't gotten more attention.
    Incidentally brian_c, I tried to look at your linked videos but it returns the message that the videos violated the TOS of the site...?

  • How can I use Local SPAN with RSPAN ??

    How can I use Local SPAN with RSPAN ??
    I want to mirror traffics from ISP-A and ISP-B to Anomaly-detector module.
    so I had configured like this...
    C6500-A
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    monitor session 20 destination anomaly-detector-module 3 data-port 1
    monitor session 20 source remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    C6500-B
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    end
    but it was not working..
    it wasn't any change of input packet hit count when
    I'd enter a command 'show anomaly-detector module 3 data-port 1 traffic'
    was upper configuration wrong..?
    Can I use VACL configuration ?

    try to change "monitor session 10 destination remote vlan 1000 " to "monitor session 10 destination anomaly-detector-module 3 data-port 1 " on C6500-A

  • How can I import pictures from my iphone to PC which I imported to the iphone from another PC? The folder doesn't show on my computer. I see all other pictures I took with the phone but not the imported folder.

    How can I import pictures from my iphone to PC which I imported to the iphone from another PC? The folder doesn't show on my computer. I see all other pictures I took with the phone but not the imported folder.

    Photos that were synced from a computer won't show for copying to a computer. If you want to copy them back then you will need a third-party app on your phone such as Simple Transfer which can copy them off via your wifi network. But photos are 'optimised' when they are synced to a device, any that you then copy back to a computer may not be exactly the same as they originally were on your computer (e.g. their dimensions might be different and their colours may look a bit different).

  • Why can I login to iTunes from my phone with no problem, but I can't login to iTunes from my desktop.

    Why can I login to iTunes from my phone with no problem, but I can't login to iTunes from my desktop using the same login credentials. I can use a different appleID and login to itunes with no problem.

    Thanks for your reply.  I mean that only when all of my music in the cloud is shown on my phone can I delete the music stored on my phone.  I should be able to delete music that is stored on my phone when I can view ONLY the music that is taking up the phone's memory.

  • How i can print from my iPad with airport expres

    How i can print from my iPad with airport expres

    Hi - you would need to purchase a printer that is enabled to print from an iPad, iPhone or iPod - these would include ePrint, iPrint and AirPrint printers - you would then install the appropriate app on you iPad and be able to print - the installation setup for each type of printer would enable you to do this.

  • Can't open local files with v11.0.06 ("not supported or damaged")

    Hello there!
    We got some recent issues with the new Adobe Reader XI v11.0.06.
    Some files (currently two) can't be opened with the new version - although they can be opened with older versions (i.e. 9.4.3 and 10.1.0).
    Following error message appears:
    "Adobe Reader could not open 'asdf.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)." - (i hope that's it, i'm using the german version)
    (Win7 Professional SP1 64-bit)
    Thanks!

    I have searched a lot and just found other problems like NONE of the .pdf's working or failed permissions to open one - but not one entry like this where just some special .pdf's can't be opened.
    (i hope i can collapse that text, else it's getting quite long)
    `ê  %PDF-1.4
    %âãÏÓ
    1 0 obj
      <<
        /Author()/Title()/Subject()/Producer()/Keywords()/CreationDate()/ModDate()/Creator(Sub Systems, Inc.)
      >>
    endobj
    Thanks for your answer!
    Message was edited by: Pat Willener - long data stream truncated.

Maybe you are looking for

  • Trying to set up Firefox Sync and it says my email address is already in use, but won't let me sign in.

    I'm trying to Sync Firefox between my new Android phone with my Macbook Air. It tells me I need to create an account, but says my email address is already in use. So I try to put in the codes in the three boxes, and it leads me back to set up a new a

  • My iPod is not playing certain songs.

    Okay, so I go to listen to a song. The screen shows the normal stuff when playing a song EXCEPT it will not play. it shows the album art, artist, song, album, everything exept it simply will not play. it as if it it permanantly paused. i can scroll t

  • Print BP Address udf's on Marketing Documents

    We have created two udf's with the Business Partner Bill and Ship To Address's (crd1). We need to print these on marketing documents with the rest of the address. The udf's don't carry over from the BP to the marketing document when it is created and

  • Brand Search Box SharePoint 2013

    I need to brand OOTB search box like the below image in SharePoint 2013. current,i inserted a following in the design manager master page for search textbox  <div class="customsearch">                                 <!--MS:<asp:ContentPlaceHolder id

  • Store common date for the sales and related subsequent rebates credit memo

    Hi,   Iam working one object for  Reporting Date in COPA. User Exit :  COPA0005 Function Exit : EXIT_SAPLKEII_001    This user exit will be triggered for all PA posings in COPA. in this exit import parameter is i_item and  export parameter is E_item.