I am looking for a way to keep the ssh private key from unauthorized reading while…
- User
I am looking for a way to keep the ssh private key from unauthorized reading while prompting for password as few as possible on macOS. I come up with two ways:
- The first way is to save a passphrase-encrypted private key file and add its passphrase to the macOS keychain. I can also use santa to restrict the file access to the private key file to only the ssh processes signed by Apple. But there may be some concerns:
- It seems that applications can use the ssh command to connect to the servers with my private key, because the ssh command (which is signed by Apple) is permitted to read the private key file and the passphrase in the macOS keychain.
- I do not know whether an unauthorized application can use the same access group as the Apple ssh and read the passphrase in the macOS keychain.
- Are there any other potential security issues?
- The second way is to use the secretive app that saves the private key to the macOS keychain and prompting for torch ID / showing notification each time some app requires the key. But there may be some concerns:
- The first way is to save a passphrase-encrypted private key file and add its passphrase to the macOS keychain. I can also use santa to restrict the file access to the private key file to only the ssh processes signed by Apple. But there may be some concerns:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.