I am trying to mount private keys from USB stick. OSx does not allow me to change their permissions, why? How can I change them? In other words, how can I add private keys from random USB stick to ssh-agent?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
I'll bet your USB stick is formatted as FAT, FAT32 or NTFS. OS X's Unix-style permissions are not compatible with FAT and FAT32 filesystems. Additionally, by default, OS X cannot write to NTFS volumes. Make sure the USB stick is formatted as HFS+.
And finally, the file containing the SSH private key must have permissions set to
600 and the folder containing the file must have permissions set to
As late as OS X 10.13/High Sierra, you can add an
/etc/fstab file owned by root, even if it doesn't exist on your system, with the following content:
LABEL=PRIVATE none msdos -u=501,-m=700
This assumes that your user ID is 501 (check with
ls -n ~) and that the label of your mounted FAT/ExFAT drive is
PRIVATE. I use this for mounting VeraCrypt volume-files with ssh keys (FAT and ExFAT) that I share b/w OS X and Linux. Should work with USB drives as well, but haven't tried exactly that.