This is an old revision of the document!

open

Establishes new connection.

open <session_url>
open <stored_session>

Advertisement

Establishes connection to given host. Use session URL or name of the stored session (to open session, stored in folder, use path syntax “folder/session”). 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 or stored session. With SSH you may alternatively use passphrase-less private key or use Pageant. With SSH and FTPS you need to verify the host or certificate.

Switches:

Switch Description
-privatekey=<key> Private key path
-timeout=<sec> Server response timeout
-hostkey=“<fingerprint>” Specifies fingerprint of expected SSH host key (or several alternative fingerprints separated by semicolon). It makes WinSCP automatically accept hostkey with the fingerprint. As the hostkey fingerprint contains spaces you need to enclose it in quotes. Learn how to obtain host key fingerprint. SFTP and SCP protocols only.
-certificate=“<fingerprint>” Specifies fingerprint of expected SSL/TLS sertificate (or several fingerprints separated by semicolon). It makes WinSCP automatically accept certificate with the fingerprint. FTPS protocol only.
-passive=on|off Enables passive (=on) or active (=off) transfer mode (FTP protocol only). This feature is available only in the latest beta release.
-implicit Implicit TLS/SSL (FTPS protocol only)
-explicitssl Explicit SSL (FTPS protocol only)
-explicittls Explicit TLS (FTPS protocol only)
-rawsettings setting1=value1 setting2=value2 Allows configuring any session settings using raw format as in an INI file. E.g. to enable SSH compression and agent forwarding use -rawsettings Compression=1 AgentFwd=1. This feature is available only in the latest beta release.

Advertisement

XML log element: session

Examples

open sftp://martin:mypassword@example.com -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
open scp://test@example.com:2222 -privatekey=mykey.ppk
open ftps://martin@example.com -implicit -certificate="xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
open martin@example.com
open example.com
open

Last modified: by martin