Skip to content

Commit

Permalink
communicator: add note to docs on protocol/Windows
Browse files Browse the repository at this point in the history
Recently, an update to Windows's default SSH implementation added an
extra check for the mark-of-the-web to their code, which if in verbose
mode, ends-up producing an error log, and terminates the process with a
non-zero error code, even if the transfer is successful.

Because of this, scp transfers fail all the time in such an environment,
and the recommended workaround for now is to set sftp as the transfer
protocol, as this one sets the mark-of-the-web successfully, and
therefore ends with a 0 error code.

Since this is surprising behaviour to users, we add a paragraph to the
docs, so they know about this workaround.
  • Loading branch information
lbajolet-hashicorp committed Jan 10, 2023
1 parent b493aea commit f7fbef7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@

- `ssh_file_transfer_method` (string) - `scp` or `sftp` - How to transfer files, Secure copy (default) or SSH
File Transfer Protocol.

NOTE: for guests using Windows with Win32-OpenSSH v9.1.0.0p1-Beta, scp
(the default protocol for copying data) returns an error since the MOTW
cannot be set, and the command ends-up with a non-zero error code, making
transfers fail in this case. This can be solved by overriding the protocol
with SFTP instead.

- `ssh_proxy_host` (string) - A SOCKS proxy host to use for SSH connection

Expand Down
6 changes: 6 additions & 0 deletions communicator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@ type SSH struct {
SSHBastionCertificateFile string `mapstructure:"ssh_bastion_certificate_file"`
// `scp` or `sftp` - How to transfer files, Secure copy (default) or SSH
// File Transfer Protocol.
//
// NOTE: for guests using Windows with Win32-OpenSSH v9.1.0.0p1-Beta, scp
// (the default protocol for copying data) returns an error since the MOTW
// cannot be set, and the command ends-up with a non-zero error code, making
// transfers fail in this case. This can be solved by overriding the protocol
// with SFTP instead.
SSHFileTransferMethod string `mapstructure:"ssh_file_transfer_method"`
// A SOCKS proxy host to use for SSH connection
SSHProxyHost string `mapstructure:"ssh_proxy_host"`
Expand Down

0 comments on commit f7fbef7

Please sign in to comment.