Set keyfile to use for SFTP
If you want to specify the keyfile used for an SFTP connection, you can use the following:
sftp -i /path/to/private/keyfile user@machine1:/path/to/file user@machine2:/path/to/file
Found this useful? Everything here is free and stays that way. If it saved you an afternoon, you can buy me a coffee.