Raw Site Settings

You can use raw site settings to setup advanced site settings.

In GUI, when configuring advanced settings which are not available on Advanced Site Settings dialog, use Raw Site Settings dialog.

In scripting, use -rawsettings switch of scripting command open (when the settings cannot be configured using session URL nor using any dedicated switch of the command).

Advertisement

In .NET assembly, use SessionOptions.AddRawSettings method (when the settings cannot be configured using any dedicated property of SessionOptions class).

For both scripting and .NET assembly, you can just configure the advanced settings on Advanced Site Settings dialog and have WinSCP generate the code for you.

See also raw transfer settings and raw configuration.

You will also use raw site settings syntax to mass-modify stored sites using /batchsettings command-line parameter.

Common Advanced Settings

Name Description Values
PingType Keepalives1 0 = Off, 1 = Sending of null SSH packets, 2 = Executing dummy protocol commands
PingIntervalSecs Seconds between keepalives
EncryptKeyPlain File encryption key
ProxyMethod Proxy type 0/None, 1/SOCKS4, 2/SOCKS5, 3/HTTP, 4/Telnet (SFTP/SCP protocols only), 5/Cmd = Local (SFTP/SCP). For additional options with FTP protocol, see FtpProxyLogonType. Symbolical value names are supported by the latest version only.
ProxyHost Proxy host name
ProxyPort Proxy port number
ProxyUsername Proxy username
ProxyPassword Proxy password
FtpProxyLogonType FTP proxy types 1 = SITE %host, 2 = USER %proxyuser, USER %user@%host, 3 = OPEN %host, 4 = USER %proxyuser, USER %user, 5 = USER %user@%host, 6 = USER %proxyuser@%host, 7 = USER %user@%host %proxyuser, 8 = USER %user@%proxyuser@%host
ProxyDNS Do DNS name lookup at proxy end 0 = No, 1 = Auto, 2 = Yes
ProxyLocalhost Consider proxying local host connections 0/off = Off, 1/on = On
ProxyTelnetCommand Telnet proxy command
ProxyLocalCommand Local proxy command
Compression SSH session compression 0/off = Disabled, 1/on = Enabled
AddressFamily Internet Protocol Version 0 = Auto, 1 = IPv4, 2 = IPv6
SshNoUserAuth Bypass authentication entirely 0/off = Disabled, 1/on = Enabled
Cipher SSH encryption cipher selection policy Comma-separated list of cipher preference order, where names of ciphers are aes, blowfish, 3des, arcfour and des. Token WARN is used to delimit substandard ciphers. Example: blowfish,aes,3des,WARN,arcfour,des
KEX Key exchange algorithm selection policy Comma-separated list of KEX preference order, where names of KEXes are ecdh (ECDH), dh-gex-sha1 (DH Group Exchange), dh-group14-sha1 (DH group 14), rsa (RSA-based), and dh-group1-sha1 (DH group 1). Token WARN is used to delimit substandard KEXes. Example: ecdh,dh-gex-sha1,dh-group14-sha1,rsa,WARN,dh-group1-sha1
HostKey Host key algorithm selection policy Comma-separated list of algorithm preference order, where names of algorithms are ed448, rsa, dsa, ecdsa and ed25519. Token WARN can used to delimit substandard algorithms. Example: ed448,ed25519,ecdsa,rsa,dsa,WARN
RekeyBytes Max data before rekey
AuthKI Attempt keyboard-interactive authentication 0/off = Disabled, 1/on = Enabled
AuthGSSAPI Attempt GSSAPI authentication 0/off = Disabled, 1/on = Enabled
TryAgent Attempt Authentication Using Pageant 0/off = Disabled, 1/on = Enabled
LogicalHostName Logical name of remote host/GSSAPI/SSPI/Kerberos Service principal name/Server realm
SourceAddress Source IPv4 address (network interface) of outgoing SSH connection
GSSLibs Preference order of GSSAPI libraries Comma (,) separated list of gssapi32, sspi and custom.
GSSCustom User-supplied GSSAPI library path
FtpAccount FTP account
FtpForcePasvIp2 Force IP address for passive mode connections 0/on = On, 1/off = Off, 2/auto = Auto
FtpUseMlsd Use MLSD command for directory listing 0/on = On, 1/off = Off, 2/auto = Auto
FtpListAll Support for listing of hidden files 0/on = On, 1/off = Off, 2/auto = Auto
FtpAnyCodeForPwd Allow any 2xx response code to FTP PWD command 0/off = Disabled, 1/on = Enabled
FtpWorkFromCwd Always change working directory before FTP commands. 0/on = On, 1/off = Off, 2/auto = Auto (use on VMS servers)
S3CredentialsEnv Credentials from AWS environment 0/off = Disabled, 1/on = Enabled
Tunnel Connection tunneling 0/off = Disabled, 1/on = Enabled
TunnelHostName Tunnel host name
TunnelPortNumber Tunnel port number
TunnelUserName Tunnel user name
TunnelPasswordPlain Tunnel password
TunnelHostKey Fingerprint of expected SSH tunnel host key
TunnelPublicKeyFile Path to tunnel private key file
TunnelLocalPortNumber Local tunnel port 0 = Autodetect
Utf UTF-8 Encoding for Filenames 0 = Off, 1 = On, 2 = Auto
Shell Shell (SCP protocol)
ListingCommand Listing command
LookupUserGroups2 Lookup user groups 0/on = On, 1/off = Off, 2/auto = Auto
LocalDirectory Local Directory2
TimeDifference Time zone offset Hexadecimal representation of 64-bit IEEE 754 floating point number (double), representing the offset in days.
Example: 555555555555A5BF = -1 hour3
ConsiderDST Daylight Saving Time 0 = Adjust remote timestamp with DST, 1 = Adjust remote timestamp to local conventions, 2 = Preserve remote timestamp
ResolveSymlinks Resolve symbolic links 0/off = Disabled, 1/on = Enabled
FollowDirectorySymlinks Follow symbolic links to directories 0/off = Disabled, 1/on = Enabled
ExitCode1IsError Consider exit code 1 from remote commands as an error. 0/off = Disabled, 1/on = Enabled
SftpServer Path to SFTP server binary For example sudo su -c /bin/sftp-server
SFTPMaxVersion Preferred SFTP protocol version 05 = SFTP version number
SFTPRealPath Canonicalize SFTP paths 0/on = On, 1/off = Off, 2/auto = Auto
MinTlsVersion Minimum TLS/SSL version 3 = SSL 3.0, 10 = TLS 1.0, 11 = TLS 1.1, 12 = TLS 1.2
MaxTlsVersion Maximum TLS/SSL version See MinTlsVersion
SendBuf Optimize connection buffer size 0 = Off, Any positive value = On, value indicates size of the buffer, with recommended value of 262144
The SshSimple may need to be set to 0 to disable some of the optimizations, that unchecking the GUI option disables.
EOLType End-of-line characters 0 = LF, 1 = CRLF
TrimVMSVersions Trim VMS Version Numbers 0/off = Off, 1/on = On
PostLoginCommands FTP Post login commands If you need to execute multiple commands, separate them by new-line (line-feed, hexadecimal UTF-8 code 0A). I.e. in scripting use %0A (-rawsettings PostLoginCommands=CMD1%0ACMD2), in C# use \n, in PowerShell use `n
InternalEditorEncoding Override of default internal editor encoding -1 = use global preferences, 0 = ANSI encoding, 65001 = UTF-8 encoding.
DeleteToRecycleBin Preserve deleted remote files to recycle bin 0/off = Off, 1/on = On
OverwrittenToRecycleBin Preserve overwritten remote files to recycle bin 0/off = Off, 1/on = On
RecycleBinPath Remote recycle bin
ProtocolFeatures Protocol features override Comma-separated list of features override. If the list starts with *, it completely overrides protocol features. If not, individual listed features should start with - or +, to remove or add the feature. For SFTP protocol, it overrides SFTP extensions list. For FTP protocol, it overrides features declared by FEAT command response.

Advertisement

Example

For example to enable HTTP proxy, in scripting:

open <session_url> -rawsettings ProxyMethod=3 ProxyHost=proxy

or in .NET assembly (using PowerShell):

$sessionOptions.AddRawSettings("ProxyMethod", "3")
$sessionOptions.AddRawSettings("ProxyHost", "proxy")

Keywords

For boolean settings that have values 0 for Off/Disabled and 1 for On/Enabled (like AuthGSSAPI), you can use off and on keywords instead.

For settings that have values 0 for On, 1 for Off and 2 for Auto (like FtpUseMlsd), you can use on/off/auto keywords instead.

  1. Enabling keepalives has very limited effect in scripting (except for keepuptodate command) and almost no effect in .NET assembly.Back
  2. Note that Remote Directory can be set using session URL, you do not need to use raw site settings for it.Back
  3. In C# you can calculate -1 hour offset using: string.Join("", BitConverter.GetBytes(TimeSpan.FromHours(-1).TotalDays).Select(b => b.ToString("X2"))).Back

Last modified: by martin