Differences

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

2023-02-09 2023-02-10
6.0 Change: SessionOptions.WebdavSecure renamed to SessionOptions.Secure (and applies to S3 protocol too). (martin) 6.0 Bug 2102: Reading password from a file (martin)
Line 21: Line 21:
| ''-==clientcert===%%<file>%%''      | [[tls#client_certificate|TLS/SSL client certificate]] path. \\ [[ftps|FTPS]] and [[webdav|WebDAVS]] protocols only. | | ''-==clientcert===%%<file>%%''      | [[tls#client_certificate|TLS/SSL client certificate]] path. \\ [[ftps|FTPS]] and [[webdav|WebDAVS]] protocols only. |
| ''-==certificate===%%"<fingerprint>"%%'' | Specifies fingerprint of expected [[tls#certificate|TLS/SSL certificate]] (or several fingerprints separated by semicolon). It makes WinSCP automatically [[scripting#hostkey|accept certificate]] with the fingerprint. Use SHA-256 fingerprint of the certificate. \\ 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]] and [[webdav|WebDAVS]] protocols only. | | ''-==certificate===%%"<fingerprint>"%%'' | Specifies fingerprint of expected [[tls#certificate|TLS/SSL certificate]] (or several fingerprints separated by semicolon). It makes WinSCP automatically [[scripting#hostkey|accept certificate]] with the fingerprint. Use SHA-256 fingerprint of the certificate. \\ 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]] and [[webdav|WebDAVS]] protocols only. |
-| ''-==passphrase===<phrase>''    | Passphrase for encrypted private keys and client certificates. \\ SFTP, SCP, FTPS and WebDAVS protocols only. |+| ''-==passphrase===<phrase>''    | Passphrase for encrypted private keys and client certificates. \\ SFTP, SCP, FTPS and WebDAVS protocols only. \\ The passphrase [[#passwordsfromfiles|can be read from a file]]. |
| ''-==passive===on%%|%%off''                | Selects [[ui_login_connection#connection|passive]] (''on'') or active (''off'') transfer mode ([[FTP]] protocol only). | | ''-==passive===on%%|%%off''                | Selects [[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 27: Line 27:
| ''-==timeout===<sec>''          | Server response timeout. | | ''-==timeout===<sec>''          | Server response timeout. |
| ''-==username===%%<user>%%'' | An alternative way to provide a username. The username is normally part of the [[session_url|session URL]]. Using this switch has the advantage of not needing to [[session_url#special|URL-encode special characters]]. | | ''-==username===%%<user>%%'' | An alternative way to provide a username. The username is normally part of the [[session_url|session URL]]. Using this switch has the advantage of not needing to [[session_url#special|URL-encode special characters]]. |
-| ''-==password===%%<pass>%%'' | An alternative way to provide a password. The password is normally part of the session URL. Using this switch has the advantage of not needing to URL-encode special characters. |+| ''-==password===%%<pass>%%'' | An alternative way to provide a password. The password is normally part of the session URL. Using this switch has the advantage of not needing to URL-encode special characters. \\ The password [[#passwordsfromfiles|can be read from a file]]. |  
 +| ''-==passwordsfromfiles=='' | Interpret values of [[#password|''-password'']], [[#passphrase|''-passphrase'']] and in general all passwords from all sources as paths to files, where the actual passwords are read from. The files must use UTF-8 or UTF-16 encoding.((With UTF-8 encoding use of BOM is optional. With UTF-16 the BOM is mandatory. Only the first line of the file is considered. Use of more lines is reserved for the future.)) &beta_feature |
| ''-==rawsettings== setting1=value1 setting2=value2 ...'' | Allows configuring any site settings using [[rawsettings|raw format]] as in an INI file (with optional use of [[rawsettings#keywords|keywords]]). E.g. to enable SSH compression and agent forwarding use ''-rawsettings Compression=on AgentFwd=on''. The switch must come after session URL. | | ''-==rawsettings== setting1=value1 setting2=value2 ...'' | Allows configuring any site settings using [[rawsettings|raw format]] as in an INI file (with optional use of [[rawsettings#keywords|keywords]]). E.g. to enable SSH compression and agent forwarding use ''-rawsettings Compression=on AgentFwd=on''. The switch must come after session URL. |
| ''-==filezilla==''              | Load ''site'' from FileZilla site manager.((WinSCP looks for sites in ''C:\Users\username\AppData\Roaming\FileZilla\sitemanager.xml''. &winpath)) \\ Additionally it prints a full syntax to use to open an identical session without relying on an external FileZilla configuration. | | ''-==filezilla==''              | Load ''site'' from FileZilla site manager.((WinSCP looks for sites in ''C:\Users\username\AppData\Roaming\FileZilla\sitemanager.xml''. &winpath)) \\ Additionally it prints a full syntax to use to open an identical session without relying on an external FileZilla configuration. |
Line 74: Line 75:
| ''-explicit''      | Set ''[[library_sessionoptions#ftpsecure|SessionOptions.FtpSecure]]'' to ''FtpSecure.Explicit'' (''[WinSCP.FtpSecure]::Explicit''). | | ''-explicit''      | Set ''[[library_sessionoptions#ftpsecure|SessionOptions.FtpSecure]]'' to ''FtpSecure.Explicit'' (''[WinSCP.FtpSecure]::Explicit''). |
| ''-timeout''      | Set ''[[library_sessionoptions#timeout|SessionOptions.Timeout]]''. | | ''-timeout''      | Set ''[[library_sessionoptions#timeout|SessionOptions.Timeout]]''. |
 +| ''-passwordsfromfiles'' | Read the file in your code and assign a respective property. \\ PowerShell example: ''$sessionOptions.Password = (Get-Content $path)[0]'' |
| ''-rawsettings''  | Call ''[[library_sessionoptions_addrawsettings|SessionOptions.AddRawSettings]]'' for every key/value pair in switch parameters. | | ''-rawsettings''  | Call ''[[library_sessionoptions_addrawsettings|SessionOptions.AddRawSettings]]'' for every key/value pair in switch parameters. |
| ''-filezilla''    | Convert the full equivalent syntax suggested, when the ''open'' command is executed. | | ''-filezilla''    | Convert the full equivalent syntax suggested, when the ''open'' command is executed. |

Last modified: by martin