Your shell is probably incompatible with the application (BASH is recommended)
Hello,
I have a PowerShell script. I am using SFTP.
The default shell in the target host is
I get this error:
Question is: How can I direct SFTP to use
Note:
I cannot change the default host from
https://winscp.net/eng/docs/rawsettings
Shell (SCP protocol)
In this post (Connection has been unexpectedly closed. Server sent command), someone suggested he/she can change the shell:
Regards, Raul.
I have a PowerShell script. I am using SFTP.
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{ Protocol = [WinSCP.Protocol]::Sftp HostName = $hostname UserName = $config.Configuration.UserName SecurePassword = ConvertTo-SecureString $config.Configuration.Password }
ksh
. I want to execute a command:
$Command = "ls -ltr" $output = $session.ExecuteCommand($Command)
If I execute this command against a host where the default shell isYour shell is probably incompatible with the application (BASH is recommended)
/bin/bash
, it works.
Question is: How can I direct SFTP to use
ksh
as the shell for the command execution?
Note:
I cannot change the default host from
ksh
to bash
because it is a company policy and I have hundreds of hosts.
-rawsettings
option shell
, the documentation states is only for SCP protocol
https://winscp.net/eng/docs/rawsettings
Shell (SCP protocol)
In this post (Connection has been unexpectedly closed. Server sent command), someone suggested he/she can change the shell:
but does not explain how.Oh, you know, looking through the options I changed the shell to/bin/ksh
and it worked.
Regards, Raul.