On 14Feb2024 22:49, Alex <mysqlstudent(a)gmail.com> wrote:
> You don't need sshpass if you have the private key matching
the
> public key already stored on the server. Just use ssh.
This would be for use in a script - I'm assuming someone would use it as
part of an automated backup script or when it's not possible to be at the
keyboard to enter that passphrase.
I usually make a special purpose keypair with no passphrase for this,
with a distinctive filename, eg .ssh/id_dsa_backups and its .pub
partner. You can lock down the authorized_keys file at the far end to
constrain its use, too.
Remember "expect"? It sounds reminiscent of that from the
90s.
Ugh.
Cheers,
Cameron Simpson <cs(a)cskk.id.au>