Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Your shell is probably incompatible with the application (BASH is recommended)

You cannot use ksh, that's the point. You have to use bash.
Use the Shell raw site settings to force bash instead of the default ksh.
Ayudo98

Your shell is probably incompatible with the application (BASH is recommended)

Hello,

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
}

The default shell in the target host is ksh. I want to execute a command:
$Command = "ls -ltr"
$output = $session.ExecuteCommand($Command)

I get this error:
Your shell is probably incompatible with the application (BASH is recommended)

If I execute this command against a host where the default shell is /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:
Oh, you know, looking through the options I changed the shell to /bin/ksh and it worked.

but does not explain how.

Regards, Raul.