Time Machine Security vs Automated Script ssh key Security
Hi,
I've been playing around with how to use rsync with ssh in an automated script to send some data to a network attached storage box. Options:
1) Use a "user id" and the script will prompt for a password.
2) Use an ssh key with no pass phrase and the script won't prompt for anything, but the private key is setting in the clear in a file (both on the local system and on the NAS if I send this file).
3) Use an ssh key with a pass phrase and the script will prompt for the phase phrase.
4) Put user ID passwrod or ssh key pass phrase in the user's key chain and the script won't ask for anything if the key safe is not locked (i.e. I'm logged in).
1, 2, and 4 don't work for a Cron job and 2 is not cryptographically secure.
So 1st question: Is there some other way to do this or am I misunderstanding something?
I've also noticed that Time machine asks for a user ID/password for a remote server and that it CAN run when the user is not logged in. Understand it is a system daemon that can run after the user logs out, but I'm curious about how it is securing the user credentials such that it is not limited like the cases I described above for the script. I can think that there are a few possibilities :
a) The deamon gets the information it needs when the user sets up time machine, stores it in the user's key chain, and keeps it in memory while it is running. This would work until power was turned off and would stop working after power up until the user unlocked the key chain.
b) The deamon has it's own key chain and it also knows the key chain password to unlock it at power on - which is not a cryptographically secure solution (the key is known to the program and could be obtained from analyzing the code).
c) The deamon has it's own key chain and talks over the internet (to Apple) to get the key to unlock it's key chain at power on. This is secure, but requires an internet connection.
d) Some other crypto magic with the TPM on the system.
So the 2nd question: Is Time Machine is secure, and, if so, how does it manage the credentials for remote servers.
Mac Studio