Change password for password-protected DMG file

How can one change the password for a password-protected dmg file? I'd like to use a different password for the contents, but really don't want to have to recreate the whole protected folder in order to do so.

iMac 24″, macOS 15.6

Posted on Nov 15, 2025 2:34 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 15, 2025 6:30 PM

Before you do anything, make sure you have a good backup of this encrypted DMG file just in case something goes wrong.


While you should always have frequent & full backups of your system, for this you can just make a local copy of the DMG file to the same APFS volume (with the APFS file system, a local copy to the same APFS volume will just create another link to the same physical data so it should not require any extra storage space at least until you make changes to the data within the DMG file).



You will need to use the Terminal app to change the DMG's password.


The command template is:

hdiutil  chpass  <path-to-encrypted-DMG>



For those unfamiliar with the command line, it is easiest if you first type "hdiutil chpass " into the Terminal making sure to leave at least one space at the end of the line:

hdiutil  chpass  


Now find your encrypted DMG file with the Finder......drag & drop the DMG file from the Finder onto the open Terminal window so the full path to the DMG is auto filled. It will end up looking something like:

hdiutil  chpass  /Users/hwtech/Documents/Encrypted.dmg



Press the "Return" key to submit the command to be executed. You will be prompted to enter your current password for the encrypted DMG, followed by a prompt to enter the new password & another prompt to confirm the new password.


I have tested this command with both the DMG file locked & unlocked/mounted....it doesn't seem to make a difference, personally I would recommend unmounting/ejecting the mounted DMG first just to be 100% safe.


11 replies
Question marked as Top-ranking reply

Nov 15, 2025 6:30 PM in response to Dannymac22

Before you do anything, make sure you have a good backup of this encrypted DMG file just in case something goes wrong.


While you should always have frequent & full backups of your system, for this you can just make a local copy of the DMG file to the same APFS volume (with the APFS file system, a local copy to the same APFS volume will just create another link to the same physical data so it should not require any extra storage space at least until you make changes to the data within the DMG file).



You will need to use the Terminal app to change the DMG's password.


The command template is:

hdiutil  chpass  <path-to-encrypted-DMG>



For those unfamiliar with the command line, it is easiest if you first type "hdiutil chpass " into the Terminal making sure to leave at least one space at the end of the line:

hdiutil  chpass  


Now find your encrypted DMG file with the Finder......drag & drop the DMG file from the Finder onto the open Terminal window so the full path to the DMG is auto filled. It will end up looking something like:

hdiutil  chpass  /Users/hwtech/Documents/Encrypted.dmg



Press the "Return" key to submit the command to be executed. You will be prompted to enter your current password for the encrypted DMG, followed by a prompt to enter the new password & another prompt to confirm the new password.


I have tested this command with both the DMG file locked & unlocked/mounted....it doesn't seem to make a difference, personally I would recommend unmounting/ejecting the mounted DMG first just to be 100% safe.


Nov 16, 2025 2:32 PM in response to Dannymac22

Dannymac22 wrote:

My point was that if you want to experiment and, say, make a copy of the volume and change the password on ONE of them but not the other, thus protecting the other, that doesn't work! What you do on one happens to the other as well.

I copied the encrypted DMG and changed the password on one of them & verified the password on the other DMG remained the original password. I thought of that before suggesting you copy the DMG file. I did the test on macOS Tahoe.


Nov 16, 2025 1:24 PM in response to MrHoffman

MrHoffman wrote:

Disk Utility can change the password with an external device, and I;d try this with a DMG:

https://discussions.apple.com/content/attachment/ed38de64-8dd3-4afe-85f1-88f9ef44d197

FYI, the "Change Password" option is grayed out for me. I don't see any way to change the encrypted DMG's password with the Disk Utility GUI. I had checked before posting, but somehow missed the grayed out "Change password" option. I am currently running Tahoe for this test, but the screenshot of the article you posted does mention "Tahoe".


After reading that article multiple times, I think it is another case of Apple not being able to properly write documentation, or Apple broke something. That article is referencing both DMGs and physical drives/volumes. I'm guessing, the portion you highlighted is referencing a physical encrypted volume, or Apple has broken the ability in Disk Utility to change the password of an encrypted DMG.

Nov 15, 2025 7:34 PM in response to Dannymac22

Dannymac22 wrote:

That's telling me how to set password on a volume after I erase it. But I suppose I could copy everything on the volume to an unprotected folder, erase and repassword the volume, and then copy everything back onto it.


So to confirm, the volume with the password was mounted, and then checked for the change password knob in the sidebar?

Nov 16, 2025 1:10 PM in response to Dannymac22

Dannymac22 wrote:

Ah, excellent. That worked a treat. Thank you! Also, interesting that if you just duplicate the volume, you're not really creating an independent copy. You're just creating another link to the same copy.

You're welcome.


Yes, the links point to the same physical single copy of the data. As the data in one of them changes, then it does begin to increase the amount of storage used so the single physical copy begins to morph into two separate physical entities. So be careful.

Change password for password-protected DMG file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.