3

I am using WinSCP to automate the copy process to server and the authentication is only with username and password.

Script is:

open username:password@ipaddress:portno -hostkey=<hostkey>

Whereas now the authentication mode has to be changed to public key.

Script changed for authenticate through public key:

open username@ipaddress:portno -privatekey=mykey.ppk

Passphrase for the private key is requested after executing the above script, but is there any way that the passphrase of the private key can be provided in the same command?

1 Answer 1

2

Use the -passphrase switch of the open command.

See also WinSCP FAQ How can I connect without entering private key passphrase each time?


Also, note, that you still should use the -hostkey switch.


open username:password@ipaddress:portno -hostkey=... -privatekey=... -passphrase=...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.