Differences
This shows you the differences between the selected revisions of the page.
2013-11-18 | 2013-12-20 | ||
"host key" are two words (martin) | 5.5 removing beta tags (martin) | ||
Line 9: | Line 9: | ||
===== Remarks ===== | ===== Remarks ===== | ||
- | Establishes connection to given host. Use [[session_url|session URL]] or name of the [[session_configuration#site|site]] (stored session) &beta. To open site, stored in folder, use path syntax “folder/site”. Using session URL is preferred as it makes your script independent on the persisted configuration. | + | Establishes connection to given host. Use [[session_url|session URL]] or name of the [[session_configuration#site|site]]. To open site, stored in folder, use path syntax “folder/site”. Using session URL is preferred as it makes your script independent on the persisted configuration. |
Note that to allow the session be opened automatically without interaction, you need to make sure you provide all details, including all credentials. Generally, you need to provide a password in your [[session_url|session URL]] or [[session_configuration#site|site]]. With [[ssh|SSH]] you may alternatively use passphrase-less private key or use [[ui_pageant|Pageant]]. With SSH and [[ftps|FTPS]] you need to [[scripting#hostkey|verify the host or certificate]]. | Note that to allow the session be opened automatically without interaction, you need to make sure you provide all details, including all credentials. Generally, you need to provide a password in your [[session_url|session URL]] or [[session_configuration#site|site]]. With [[ssh|SSH]] you may alternatively use passphrase-less private key or use [[ui_pageant|Pageant]]. With SSH and [[ftps|FTPS]] you need to [[scripting#hostkey|verify the host or certificate]]. | ||
Line 17: | Line 17: | ||
| ''-privatekey=<key>'' | [[public_key#private|Private key]] path | | | ''-privatekey=<key>'' | [[public_key#private|Private key]] path | | ||
| ''-timeout=<sec>'' | Server response timeout | | | ''-timeout=<sec>'' | Server response timeout | | ||
- | | ''%%-hostkey="<fingerprint>"%%'' | Specifies fingerprint of expected [[ssh#verifying_the_host_key|SSH host key]] (or several alternative fingerprints separated by semicolon). It makes WinSCP automatically [[scripting#hostkey|accept host key]] with the fingerprint. As the host key fingerprint contains spaces you need to surround it by quotes. //Learn how to [[faq_script_hostkey|obtain host key fingerprint]]//. \\ In exceptional situations, when security is not required, you can use value ''*'' to accept any host key. In this case, script output and log file will include warning about insecure connection. &beta_feature \\ [[SFTP]] and [[SCP]] protocols only. | | + | | ''%%-hostkey="<fingerprint>"%%'' | Specifies fingerprint of expected [[ssh#verifying_the_host_key|SSH host key]] (or several alternative fingerprints separated by semicolon). It makes WinSCP automatically [[scripting#hostkey|accept host key]] with the fingerprint. As the host key fingerprint contains spaces you need to surround it by quotes. //Learn how to [[faq_script_hostkey|obtain host key fingerprint]]//. \\ In exceptional situations, when security is not required, you can use value ''*'' to accept any host key. In this case, script output and log file will include warning about insecure connection. \\ [[SFTP]] and [[SCP]] protocols only. | |
- | | ''%%-certificate="<fingerprint>"%%'' | Specifies fingerprint of expected [[ftps#certificate|TLS/SSL certificate]] (or several fingerprints separated by semicolon). It makes WinSCP automatically [[scripting#hostkey|accept certificate]] with the fingerprint. \\ In exceptional situations, when security is not required, you can use value ''*'' to accept any certificate. In this case, script output and log file will include warning about insecure connection. &beta_feature \\ [[ftps|FTPS]] protocol only. | | + | | ''%%-certificate="<fingerprint>"%%'' | Specifies fingerprint of expected [[ftps#certificate|TLS/SSL certificate]] (or several fingerprints separated by semicolon). It makes WinSCP automatically [[scripting#hostkey|accept certificate]] with the fingerprint. \\ In exceptional situations, when security is not required, you can use value ''*'' to accept any certificate. In this case, script output and log file will include warning about insecure connection. \\ [[ftps|FTPS]] protocol only. | |
| ''-passive=on%%|%%off'' | Enables [[ui_login_connection#connection|passive]] (''=on'') or active (''=off'') transfer mode ([[FTP]] protocol only). | | | ''-passive=on%%|%%off'' | Enables [[ui_login_connection#connection|passive]] (''=on'') or active (''=off'') transfer mode ([[FTP]] protocol only). | | ||
| ''-implicit'' | Implicit TLS/SSL ([[ftps|FTPS protocol]] only) | | | ''-implicit'' | Implicit TLS/SSL ([[ftps|FTPS protocol]] only) | | ||
Line 42: | Line 42: | ||
Parameters mapping: [[session_url|Session URL]] in command parameter ''session_url'' needs to be separated to its components, which are to be stored into ''SessionOptions.HostName'' (''host'' component), ''SessionOptions.UserName'' (''username''), ''SessionOptions.Password'' (''password''), ''SessionOptions.PortNumber'' (''port'') and ''SessionOptions.Protocol'' (''sftp|ftp|ftps|scp://''). | Parameters mapping: [[session_url|Session URL]] in command parameter ''session_url'' needs to be separated to its components, which are to be stored into ''SessionOptions.HostName'' (''host'' component), ''SessionOptions.UserName'' (''username''), ''SessionOptions.Password'' (''password''), ''SessionOptions.PortNumber'' (''port'') and ''SessionOptions.Protocol'' (''sftp|ftp|ftps|scp://''). | ||
- | There is no direct mapping for opening stored session/site using ''site'' parameter, becase .NET assembly [[library_from_script#default_config|does not share configuration]] with graphical/scripting mode. You need to configure all your site settings directly in your code (using ''[[library_sessionoptions|SessionOptions]]'' class). | + | There is no direct mapping for opening stored site using ''site'' parameter, because .NET assembly [[library_from_script#default_config|does not share configuration]] with graphical/scripting mode. You need to configure all your site settings directly in your code (using ''[[library_sessionoptions|SessionOptions]]'' class). |
Switches mapping: | Switches mapping: |