Differences

This shows you the differences between the selected revisions of the page.

2016-01-06 2016-01-19
exit command is mandatory (martin) direct switch or property anchored links (martin)
Line 19: Line 19:
| ''-pw passw'' | Specify the password in a [[session_url|session URL]] in an ''[[scriptcommand_open|open]]'' command in the script. \\ Example: ''open %%sftp://user:passw@example.com/%%'' | | ''-pw passw'' | Specify the password in a [[session_url|session URL]] in an ''[[scriptcommand_open|open]]'' command in the script. \\ Example: ''open %%sftp://user:passw@example.com/%%'' |
| ''-i key'' | Specify the private key using ''-privatekey'' switch in an ''[[scriptcommand_open|open]]'' command in the script. \\ Example: ''open %%sftp://user@example.com/%% -privatekey=key'' | | ''-i key'' | Specify the private key using ''-privatekey'' switch in an ''[[scriptcommand_open|open]]'' command in the script. \\ Example: ''open %%sftp://user@example.com/%% -privatekey=key'' |
-| ''%%-hostkey aa:bb:cc:...%%'' | Specify the expected hostkey using ''-hostkey'' switch in an ''[[scriptcommand_open|open]]'' command in the script. WinSCP requires key type and size in the signature. \\ Example: ''%%open sftp://user@example.com/ -hostkey="ssh-rsa 2048 aa:bb:cc...%%"'' \\ (assuming 2048-bit RSA host key) |+| ''%%-hostkey aa:bb:cc:...%%'' | Specify the expected hostkey using ''[[scriptcommand_open#hostkey|-hostkey]]'' switch in an ''[[scriptcommand_open|open]]'' command in the script. WinSCP requires key type and size in the signature. \\ Example: ''%%open sftp://user@example.com/ -hostkey="ssh-rsa 2048 aa:bb:cc...%%"'' \\ (assuming 2048-bit RSA host key) |
For example the following PSFTP command-line: For example the following PSFTP command-line:
Line 55: Line 55:
If your ''psftp.exe'' command-line does not use ''-hostkey'' switch, it means that you rely on PuTTY/PSFTP host key cache in Windows registry. That makes your script non-portable. If your ''psftp.exe'' command-line does not use ''-hostkey'' switch, it means that you rely on PuTTY/PSFTP host key cache in Windows registry. That makes your script non-portable.
-With WinSCP it's recommended to always [[scripting#hostkey|verify the host key explicitly]] using ''-hostkey'' switch of an ''[[scriptcommand_open|open]]'' command.+With WinSCP it's recommended to always [[scripting#hostkey|verify the host key explicitly]] using ''[[scriptcommand_open#hostkey|-hostkey]]'' switch of an ''[[scriptcommand_open|open]]'' command.
===== Converting Commands ===== ===== Converting Commands =====

Last modified: by martin