Topic "Can't use /bin/sh as shell."

Author Message
donald_williams-dell
[View user's profile]

Joined: 2014-02-04
Posts: 6
Location: Nashua, NH
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]
Bash-error.jpg (34.38 KB)

Description: ScreenShot showing error message

Bash-error.jpg

pscp-work.jpg (112.85 KB) [Download]

Description: Screenshot showing PSCP working to same device.

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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
donald_williams-dell
[View user's profile]

Joined: 2014-02-04
Posts: 6
Location: Nashua, NH
prikryl wrote:
Please attach a full log file showing the problem (using the latest version of WinSCP).


Here you go.

Thanks.
scp_config.txt (13 KB) [Download]

Description: WinSCP Config file

session_log.txt (15.62 KB) [Download]

Description: Session log

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
How does login to your server look like in SSH terminal (e.g. PuTTY)?
_________________
Martin Prikryl
tomo_dell
[View user's profile]

Joined: 2014-02-04
Posts: 1
Location: NH
prikryl 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.
scrt_log.txt (5.37 KB) [Download]

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
tomo_dell wrote:
prikryl 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
donald_williams-dell
[View user's profile]

Joined: 2014-02-04
Posts: 6
Location: Nashua, NH
prikryl wrote:
tomo_dell wrote:
prikryl 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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
donald_williams-dell
[View user's profile]

Joined: 2014-02-04
Posts: 6
Location: Nashua, NH
prikryl 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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.
donald_williams-dell
[View user's profile]

Joined: 2014-02-04
Posts: 6
Location: Nashua, NH
prikryl 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%
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
donald_williams-dell wrote:
If I do that, the putty session logs in and then exits.

Then WinSCP cannot work either.

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

Please read the requirements link above.
donald_williams-dell
[View user's profile]

Joined: 2014-02-04
Posts: 6
Location: Nashua, NH
prikryl wrote:
donald_williams-dell wrote:
If I do that, the putty session logs in and then exits.

Then WinSCP cannot work either.

Quote:
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?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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:
Quote:
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:
Quote:
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
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License