Can't use /bin/sh as shell.

Advertisement

donald_williams-dell
Joined:
Posts:
6
Location:
Nashua, NH

Can't use /bin/sh as shell.

The device I'm connecting to does not have /bin/bash. When I specify /bin/sh in the Advanced Site Settings I get the following error:

Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).
https://winscp.net/eng/docs/ui_login_scp#shell


WinSCP v5.5.1 and I also tried older revisions as well, 5.2.4.

Client OS: Windows 7. Tried on 64bit and 32bit systems.

Using Linux (RHEL/ubuntu) SCP, Putty SCP, Cygwin SCP, all work fine.

The device uses NetBSD 5.0 for SSH services.




[/img]

Description: Screenshot showing PSCP working to same device.

pscp-work.jpg

Description: ScreenShot showing error message

Bash-error.jpg

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.
_________________
Martin Prikryl

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

How does login to your server look like in SSH terminal (e.g. PuTTY)?
_________________
Martin Prikryl

Reply with quote

tomo_dell
Joined:
Posts:
1
Location:
NH

Re: Can't use /bin/sh as shell.

martin wrote:

How does login to your server look like in SSH terminal (e.g. PuTTY)?

I'll get this one (I work with don); I use SecureCRT.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

tomo_dell wrote:

martin wrote:

How does login to your server look like in SSH terminal (e.g. PuTTY)?

I'll get this one (I work with don); I use SecureCRT.
I've meant a regular terminal output, not a log.
_________________
Martin Prikryl

Reply with quote

donald_williams-dell
Joined:
Posts:
6
Location:
Nashua, NH

Re: Can't use /bin/sh as shell.

martin wrote:

tomo_dell wrote:

martin wrote:

How does login to your server look like in SSH terminal (e.g. PuTTY)?

I'll get this one (I work with don); I use SecureCRT.
I've meant a regular terminal output, not a log.

Not sure how that will help. When you just SSH in, a Command Line Program is called allowing Management of the device. It's not a regular shell prompt.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

donald_williams-dell wrote:

Not sure how that will help. When you just SSH in, a Command Line Program is called allowing Management of the device. It's not a regular shell prompt.
And that's exactly the reason WinSCP won't work.
See https://winscp.net/eng/docs/requirements#scp
_________________
Martin Prikryl

Reply with quote

donald_williams-dell
Joined:
Posts:
6
Location:
Nashua, NH

Re: Can't use /bin/sh as shell.

martin wrote:

donald_williams-dell wrote:

Not sure how that will help. When you just SSH in, a Command Line Program is called allowing Management of the device. It's not a regular shell prompt.
And that's exactly the reason WinSCP won't work.
See https://winscp.net/eng/docs/requirements#scp

At issue is WinSCP expecting /bin/bash. This device only has /bin/sh. When you try to specifiy /bin/sh it errors. Please see the attached screenshots. Older versions of this devices firmware, had /bin/bash and WinSCP worked fine then.

Using Linux based SCP, or PSCP from putty works fine.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

So what happens, if you ask SSH client to run /bin/sh on startup explicitly (instead of default shell)? For example in PuTTY, you can do this by going to Connection > SSH > Remote command.

Reply with quote

donald_williams-dell
Joined:
Posts:
6
Location:
Nashua, NH

Re: Can't use /bin/sh as shell.

martin wrote:

So what happens, if you ask SSH client to run /bin/sh on startup explicitly (instead of default shell)? For example in PuTTY, you can do this by going to Connection > SSH > Remote command.

If I do that, the putty session logs in and then exits.

At issue is with SCP, not an interactive SSH login.

This is what I can't do with WinSCP, that I can with Linux SCP or Putty PSCP.

c:\Program Files (x86)\PuTTY>pscp c:\upload\fixpool.sh grpadmin@10.126.205.100:.
grpadmin@10.126.205.100's password:
fixpool.sh | 0 kB | 0.8 kB/s | ETA: 00:00:00 | 100%

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

donald_williams-dell wrote:

If I do that, the putty session logs in and then exits.
Then WinSCP cannot work either.

At issue is with SCP, not an interactive SSH login.
Please read the requirements link above.

Reply with quote

donald_williams-dell
Joined:
Posts:
6
Location:
Nashua, NH

Re: Can't use /bin/sh as shell.

martin wrote:

donald_williams-dell wrote:

If I do that, the putty session logs in and then exits.
Then WinSCP cannot work either.

At issue is with SCP, not an interactive SSH login.
Please read the requirements link above.

Then why does it work fine with pscp and scp w/o modification?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Can't use /bin/sh as shell.

donald_williams-dell wrote:

Then why does it work fine with pscp and scp w/o modification?
Because strictly speaking WinSCP is not a SCP client, as:
As the SCP protocol implements file transfers only, WinSCP must use other means to implement the additional functionality (like directory listing). WinSCP uses Unix-like shell commands to do that. This in turn means that when using the SCP protocol, it can connect to servers that run Unix-like or its emulation only

Also quoting Wikipedia SCP article:
As the SCP protocol implements file transfers only, GUI SCP clients are rare, as implementing it requires additional functionality (directory listing at least). For example, WinSCP defaults to the SFTP protocol. Even when operating in SCP mode, clients like WinSCP are typically not pure SCP clients, as they must use other means to implement the additional functionality (like the ls command). This in turn brings platform-dependency problems.

https://en.wikipedia.org/wiki/Secure_copy

Reply with quote

Advertisement

You can post new topics in this forum