I have a script that runs ssh several times to do some manipulations on a remote system and also runs rsync to the same remote system two or three times.
Is there some way to get a single entry of the ssh password to work for all the ssh and rsync calls?
I *could* use key authentication but that has some downsides so I'd prefer to remain with using a password.
One approach is to use 'ControlMaster auto' in the .ssh/config which means all subsequent logins will re-use the first one, this however means that I need to have a 'persistent' first ssh. I've managed this by doing 'ssh -fN esprimo bash' at the start of the script but this then leaves the ssh running for ever and I'd prefer that not to happen.
Has anyone got any better ideas?