How can I solve this problem? I have a bash script (under Ubuntu Server), doing several SSH connections, executes some remote transfers, like rsync multiple times.
My problem is, that I would like to avoid entering password multiple times. But I don't want to use SSH public key exchange, because if anybody has the key, will be able to connect the remote computer.
I would like the following:
- SSH should ask password when I start the bash script
- reuse password, so don't ask password again until timeout
- when timeout is over, ask password again.
Something similar, how sudo is working, just with ssh.
Any idea how to solve this?
I found a new SSH feature named ssh multiplexing. Maybe using this I can reach the goal I want.
Would this work?