winscp 3.7.6 default shell setting doesn't work w/ /bin/ksh

Advertisement

obilodeau
Guest

winscp 3.7.6 default shell setting doesn't work w/ /bin/ksh

Working on old hp-ux systems, I came over this annoyance. I hope you'll be able to do something about it.

Description: I can't connect using WinSCP on old hp-ux box (ssh1 only, w/o bash) unless I specificly set shell to /bin/ksh. It's annoying and if it wasn't because of a collegue saying that scp DO work on the box I would have never used winscp on it again. Turned out that there is a workaround but I wonder if the shell could be autodetected. Forgot to tell that this user's default shell is /bin/ksh in /etc/passwd.

version 3.7.6
protocol SCP

Here's the log when Shell is Default:

. 2006-04-28 14:28:14.123 --------------------------------------------------------------------------
. 2006-04-28 14:28:14.123 WinSCP Version 3.7.6 (Build 306) (OS 5.1.2600 Service Pack 1)
. 2006-04-28 14:28:14.123 Login time: 28 avril 2006 14:28:14
. 2006-04-28 14:28:14.123 --------------------------------------------------------------------------
. 2006-04-28 14:28:14.123 Session name: xxx
. 2006-04-28 14:28:14.123 Host name: xxx (Port: 22)
. 2006-04-28 14:28:14.123 User name: xxx (Password: No, Key file: No)
. 2006-04-28 14:28:14.123 Transfer Protocol: SCP
. 2006-04-28 14:28:14.123 SSH protocol version: 1; Compression: No
. 2006-04-28 14:28:14.123 Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2006-04-28 14:28:14.123 Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
. 2006-04-28 14:28:14.123 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2006-04-28 14:28:14.123 SSH Bugs: -,-,-,-,-,-,-,-
. 2006-04-28 14:28:14.123 SFTP Bugs: -,-,-
. 2006-04-28 14:28:14.123 Proxy: none
. 2006-04-28 14:28:14.123 Return code variable: Autodetect; Lookup user groups: Yes
. 2006-04-28 14:28:14.123 Shell: default, EOL: 0
. 2006-04-28 14:28:14.123 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2006-04-28 14:28:14.123 Cache directory changes: Yes, Permanent: Yes
. 2006-04-28 14:28:14.123 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2006-04-28 14:28:14.123 Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
. 2006-04-28 14:28:14.123 --------------------------------------------------------------------------
. 2006-04-28 14:28:14.123 Looking up host "xxx"
. 2006-04-28 14:28:14.138 Connecting to xxx.xxx.xxx.xxx port 22
. 2006-04-28 14:28:14.138 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:14.138 Looking for incoming data
. 2006-04-28 14:28:14.185 Select result is 1
. 2006-04-28 14:28:14.185 Server version: SSH-1.5-1.2.31
. 2006-04-28 14:28:14.185 We claim version: SSH-1.5-WinSCP_release_3.7.6
. 2006-04-28 14:28:14.185 Using SSH protocol version 1
. 2006-04-28 14:28:14.185 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:14.185 Looking for incoming data
. 2006-04-28 14:28:14.185 Select result is 1
. 2006-04-28 14:28:14.185 Received public keys
. 2006-04-28 14:28:14.185 Host key fingerprint is:
. 2006-04-28 14:28:14.185 1024 <big key>
. 2006-04-28 14:28:14.185 Encrypted session key
. 2006-04-28 14:28:14.185 AES not supported in SSH-1, skipping
. 2006-04-28 14:28:14.185 Using Blowfish encryption
. 2006-04-28 14:28:14.185 Trying to enable encryption...
. 2006-04-28 14:28:14.185 Initialised Blowfish encryption
. 2006-04-28 14:28:14.185 Installing CRC compensation attack detector
. 2006-04-28 14:28:14.185 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:14.185 Looking for incoming data
. 2006-04-28 14:28:14.326 Select result is 1
. 2006-04-28 14:28:14.326 Successfully started encryption
. 2006-04-28 14:28:14.326 Sent username "xxx"
. 2006-04-28 14:28:14.326 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:14.326 Looking for incoming data
. 2006-04-28 14:28:14.372 Select result is 1
. 2006-04-28 14:28:14.372 Authentication successful
. 2006-04-28 14:28:14.372 Started session
. 2006-04-28 14:28:14.372 --------------------------------------------------------------------------
. 2006-04-28 14:28:14.372 Using SCP protocol.
. 2006-04-28 14:28:14.372 Doing startup conversation with host.
. 2006-04-28 14:28:14.372 Skipping host startup message (if any).
. 2006-04-28 14:28:14.372 Sent 36 bytes
. 2006-04-28 14:28:14.372 There are 0 bytes remaining in the send buffer
. 2006-04-28 14:28:14.372 Sent 1 bytes
. 2006-04-28 14:28:14.372 There are 0 bytes remaining in the send buffer
> 2006-04-28 14:28:14.372 echo "WinSCP: this is end-of-file:0"
. 2006-04-28 14:28:14.372 Waiting for another 1 bytes
. 2006-04-28 14:28:14.372 Looking for incoming data
. 2006-04-28 14:28:14.497 Select result is 1
! 2006-04-28 14:28:14.497 ttytype: couldn't open /dev/tty for reading
. 2006-04-28 14:28:14.497 Waiting for another 1 bytes
. 2006-04-28 14:28:14.497 Looking for incoming data
. 2006-04-28 14:28:14.513 Select result is 1
! 2006-04-28 14:28:14.513 stty: : Not a typewriter
. 2006-04-28 14:28:14.513 Waiting for another 1 bytes
. 2006-04-28 14:28:14.513 Looking for incoming data
. 2006-04-28 14:28:14.654 Select result is 1
! 2006-04-28 14:28:14.654 Not a terminal
! 2006-04-28 14:28:14.654 stty: : Not a typewriter
! 2006-04-28 14:28:14.654 stty: : Not a typewriter
. 2006-04-28 14:28:14.654 Waiting for another 1 bytes
. 2006-04-28 14:28:14.654 Looking for incoming data
. 2006-04-28 14:28:14.872 Select result is 1
. 2006-04-28 14:28:14.872 Received 1 bytes
. 2006-04-28 14:28:14.872 Received 136 bytes
< 2006-04-28 14:28:14.872

2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2


. 2006-04-28 14:28:14.872 Received 35 bytes
< 2006-04-28 14:28:14.872 Value of TERM has been set to "".
. 2006-04-28 14:28:14.872 Received 31 bytes
< 2006-04-28 14:28:14.872 WARNING: YOU ARE SUPERUSER !!
. 2006-04-28 14:28:14.872 Received 1 bytes
. 2006-04-28 14:28:14.872 Received 30 bytes
< 2006-04-28 14:28:14.872 WinSCP: this is end-of-file:0
. 2006-04-28 14:28:14.872 Detecting variable containing return code of last command.
. 2006-04-28 14:28:14.872 Trying "$status".
. 2006-04-28 14:28:14.872 Sent 53 bytes
. 2006-04-28 14:28:14.872 There are 0 bytes remaining in the send buffer
. 2006-04-28 14:28:14.872 Sent 1 bytes
. 2006-04-28 14:28:14.872 There are 0 bytes remaining in the send buffer
> 2006-04-28 14:28:14.872 echo "$status" ; echo "WinSCP: this is end-of-file:0"
. 2006-04-28 14:28:14.872 Waiting for another 1 bytes
. 2006-04-28 14:28:14.872 Looking for incoming data
. 2006-04-28 14:28:14.919 Select result is 1
! 2006-04-28 14:28:14.919 ksh[2]: status: parameter not set
. 2006-04-28 14:28:14.919 Waiting for another 1 bytes
. 2006-04-28 14:28:14.919 Looking for incoming data
. 2006-04-28 14:28:15.091 Select result is 1
. 2006-04-28 14:28:15.091 Server sent command exit status 1
. 2006-04-28 14:28:15.091 Server closed network connection
. 2006-04-28 14:28:15.091 Received 1 bytes
* 2006-04-28 14:28:15.091 (ESshFatal) Error detecting variable containing return code of last command.
* 2006-04-28 14:28:15.091 Connection has been unexpectedly closed. Server sent command exit status 1.





and the one with Shell is /bin/ksh:

2006-04-28 14:28:56.508 --------------------------------------------------------------------------
. 2006-04-28 14:28:56.508 WinSCP Version 3.7.6 (Build 306) (OS 5.1.2600 Service Pack 1)
. 2006-04-28 14:28:56.508 Login time: 28 avril 2006 14:28:56
. 2006-04-28 14:28:56.508 --------------------------------------------------------------------------
. 2006-04-28 14:28:56.508 Session name: xxx
. 2006-04-28 14:28:56.508 Host name: xxx (Port: 22)
. 2006-04-28 14:28:56.508 User name: xxx (Password: No, Key file: No)
. 2006-04-28 14:28:56.508 Transfer Protocol: SCP
. 2006-04-28 14:28:56.508 SSH protocol version: 1; Compression: No
. 2006-04-28 14:28:56.508 Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2006-04-28 14:28:56.508 Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
. 2006-04-28 14:28:56.508 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2006-04-28 14:28:56.508 SSH Bugs: -,-,-,-,-,-,-,-
. 2006-04-28 14:28:56.508 SFTP Bugs: -,-,-
. 2006-04-28 14:28:56.508 Proxy: none
. 2006-04-28 14:28:56.508 Return code variable: Autodetect; Lookup user groups: Yes
. 2006-04-28 14:28:56.508 Shell: /bin/ksh, EOL: 0
. 2006-04-28 14:28:56.508 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2006-04-28 14:28:56.508 Cache directory changes: Yes, Permanent: Yes
. 2006-04-28 14:28:56.508 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2006-04-28 14:28:56.508 Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
. 2006-04-28 14:28:56.508 --------------------------------------------------------------------------
. 2006-04-28 14:28:56.508 Looking up host "xxx"
. 2006-04-28 14:28:56.508 Connecting to xxx.xxx.xxx.xxx port 22
. 2006-04-28 14:28:56.523 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:56.523 Looking for incoming data
. 2006-04-28 14:28:56.570 Select result is 1
. 2006-04-28 14:28:56.570 Server version: SSH-1.5-1.2.31
. 2006-04-28 14:28:56.570 We claim version: SSH-1.5-WinSCP_release_3.7.6
. 2006-04-28 14:28:56.570 Using SSH protocol version 1
. 2006-04-28 14:28:56.570 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:56.570 Looking for incoming data
. 2006-04-28 14:28:56.570 Select result is 1
. 2006-04-28 14:28:56.570 Received public keys
. 2006-04-28 14:28:56.570 Host key fingerprint is:
. 2006-04-28 14:28:56.570 1024 <fingerprint>
. 2006-04-28 14:28:56.570 Encrypted session key
. 2006-04-28 14:28:56.570 AES not supported in SSH-1, skipping
. 2006-04-28 14:28:56.570 Using Blowfish encryption
. 2006-04-28 14:28:56.570 Trying to enable encryption...
. 2006-04-28 14:28:56.570 Initialised Blowfish encryption
. 2006-04-28 14:28:56.570 Installing CRC compensation attack detector
. 2006-04-28 14:28:56.570 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:56.570 Looking for incoming data
. 2006-04-28 14:28:56.695 Select result is 1
. 2006-04-28 14:28:56.695 Successfully started encryption
. 2006-04-28 14:28:56.695 Sent username "xxx"
. 2006-04-28 14:28:56.695 Waiting for the server to continue with the initialisation
. 2006-04-28 14:28:56.695 Looking for incoming data
. 2006-04-28 14:28:56.758 Select result is 1
. 2006-04-28 14:28:56.758 Authentication successful
. 2006-04-28 14:28:56.758 Started session
. 2006-04-28 14:28:56.758 --------------------------------------------------------------------------
. 2006-04-28 14:28:56.758 Using SCP protocol.
. 2006-04-28 14:28:56.758 Doing startup conversation with host.
. 2006-04-28 14:28:56.758 Skipping host startup message (if any).
. 2006-04-28 14:28:56.758 Sent 36 bytes
. 2006-04-28 14:28:56.758 There are 0 bytes remaining in the send buffer
. 2006-04-28 14:28:56.758 Sent 1 bytes
. 2006-04-28 14:28:56.758 There are 0 bytes remaining in the send buffer
> 2006-04-28 14:28:56.758 echo "WinSCP: this is end-of-file:0"
. 2006-04-28 14:28:56.758 Waiting for another 1 bytes
. 2006-04-28 14:28:56.758 Looking for incoming data
. 2006-04-28 14:28:56.945 Select result is 1
. 2006-04-28 14:28:56.945 Received 1 bytes
. 2006-04-28 14:28:56.945 Received 29 bytes
< 2006-04-28 14:28:56.945 WinSCP: this is end-of-file:0
. 2006-04-28 14:28:56.945 Detecting variable containing return code of last command.
. 2006-04-28 14:28:56.945 Trying "$status".
. 2006-04-28 14:28:56.945 Sent 53 bytes
. 2006-04-28 14:28:56.945 There are 0 bytes remaining in the send buffer
. 2006-04-28 14:28:56.945 Sent 1 bytes
. 2006-04-28 14:28:56.945 There are 0 bytes remaining in the send buffer
> 2006-04-28 14:28:56.945 echo "$status" ; echo "WinSCP: this is end-of-file:0"
. 2006-04-28 14:28:56.945 Waiting for another 1 bytes
. 2006-04-28 14:28:56.945 Looking for incoming data
. 2006-04-28 14:28:57.148 Select result is 1
. 2006-04-28 14:28:57.148 Received 1 bytes
. 2006-04-28 14:28:57.148 Received 30 bytes
< 2006-04-28 14:28:57.148 WinSCP: this is end-of-file:0
. 2006-04-28 14:28:57.148 Trying "$?".
. 2006-04-28 14:28:57.148 Sent 48 bytes
. 2006-04-28 14:28:57.148 There are 0 bytes remaining in the send buffer
. 2006-04-28 14:28:57.148 Sent 1 bytes
. 2006-04-28 14:28:57.148 There are 0 bytes remaining in the send buffer
> 2006-04-28 14:28:57.148 echo "$?" ; echo "WinSCP: this is end-of-file:0"
. 2006-04-28 14:28:57.148 Waiting for another 1 bytes
. 2006-04-28 14:28:57.148 Looking for incoming data
. 2006-04-28 14:28:57.351 Select result is 1
. 2006-04-28 14:28:57.351 Received 1 bytes
. 2006-04-28 14:28:57.351 Received 1 bytes
< 2006-04-28 14:28:57.351 0
. 2006-04-28 14:28:57.351 Received 30 bytes
< 2006-04-28 14:28:57.351 WinSCP: this is end-of-file:0
. 2006-04-28 14:28:57.351 Return code variable "$?" selected.
. 2006-04-28 14:28:57.351 Clearing all aliases.
. 2006-04-28 14:28:57.351 Sent 54 bytes
. 2006-04-28 14:28:57.351 There are 0 bytes remaining in the send buffer
. 2006-04-28 14:28:57.351 Sent 1 bytes
. 2006-04-28 14:28:57.351 There are 0 bytes remaining in the send buffer
> 2006-04-28 14:28:57.351 unalias "echo" ; echo "WinSCP: this is end-of-file:$?"
. 2006-04-28 14:28:57.351 Waiting for another 1 bytes
. 2006-04-28 14:28:57.351 Looking for incoming data
. 2006-04-28 14:28:57.539 Select result is 1
. 2006-04-28 14:28:57.539 Received 1 bytes
. 2006-04-28 14:28:57.539 Received 29 bytes

and it works!

Thanks for looking into it.

Reply with quote

Advertisement

obilodeau
Guest

some env var?

Can't you find it using the $SHELL environment variable?

I guess you actually already need a shell to check that but maybe once inside one and you find that it's ksh then you use whatever code is used when I explicitly define /bin/ksh in scp conf.

I guess it's not that simple. :?

Reply with quote

martin
Site Admin
martin avatar

Re: some env var?

No it's not :-)
Really, I do not plan to do such a changes in SCP code anymore. It works the best way I can do it and SCP is really legacy protocol only. I do improvements only to SFTP mostly.

Reply with quote

Advertisement

You can post new topics in this forum