Bootstrap FreeKB - Curl - Specify SSH private key file using the --key and --pass options
Curl - Specify SSH private key file using the --key and --pass options

Updated:   |  Curl articles

By default, curl will use your /home/username/.ssh/id_rsa (if it exists) private key when attempting to establish a connection to an SSH or SFTP server. The --key option can be used if you want to use some other private key file.

curl --key example.key sftp://server1.example.com

 

If the private key file is secured with a passphrase, the --pass option can be used to include the passphrase.

curl --key example.key --pass itsasecret sftp://server1.example.com

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 21e53f in the box below so that we can be sure you are a human.