0

I'm trying to create a linux script that can be called to automatically sftp into an external server using a pem key which has an associated passphrase?

As far as I can tell it would be roughly something like:

sftp -i rsa_private.pem -p rsa_private_passphrase username@ip_address

But obviously this is passing in an assumed password for the sftp account and not for the pem key... I'm relatively inexperienced with linux scripting so any help at all would be highly appreciated!

Sam White
  • 11
  • 1
  • 1
    See [How to run the sftp command with a password from Bash script?](https://stackoverflow.com/q/5386482/850848) – Martin Prikryl Jun 29 '22 at 14:50
  • So that question is asking about the sftp password, whereas I'm asking about a passphrase which has been imparted on the .pem file? – Sam White Jun 29 '22 at 15:02
  • Sure, I'm aware of that. But the solutions are pretty much the same. Except that you have an additional option of simply removing the passphrase from the key or loading the key to agent or keychain. – Martin Prikryl Jun 29 '22 at 15:05

0 Answers0