We can not prevent macOS auto mounting the Nitrokey ourselves.
I stumbled on this while reading up on how to disable automount, maybe you can figure out if/how to use it from the Nitro app.
Point is… some people will generally want to have automount on…
It’s… understandable
But here I am with one bug report and a couple of tips for other users!
Bug: the encrypted volume stays visible after locking
To reproduce:
- Unlock the encrypted volume
- Create a text file on it
- Eject the volume from Finder
- Wait for it to reappear
- Lock the encrypted volume
- Go back to the Finder: the volume is still there, you can click on it, see the text file’s icon and name and even open it (with double click)
I did not think about listing the content from the shell, maybe it’s just some Finder shenanigan, however although the content of the file showed as gibberish in TextEdit, I did not get some kind of “file not found” error.
How to deal with automount
There are two options
-
Disk Arbitrator will prevent any disk from automounting when connected, however the functionality can be accessed from the menu bar and it does not require to open Disk Utility.
-
An entry in fstab can selectively prevent a volume from automounting
$ cat /etc/fstab UUID=<encrypted volume UUID> none MSDOS rw,noauto
or
$ cat /etc/fstab LABEL=<encrypted volume label> none MSDOS rw,noauto
The UUID can be found with
diskutil info /Volumes/<label>
.