Unable to see ShellPrompt & ShellWelcomeMessage

0 votes
asked Jan 24 by sd (170 points)

Hi

I'm using FileServer component with virtual shell module. I've set ShellPrompt & ShellWelcomeMessage properties. Now when I try to connect to SSH server with Putty default settings , I can see the custom shell prompt, welcome message. However if I set the putty SSH configuration "Don't allocate a pseudo terminal" , I can't see the customized ShellPrompt & ShellWelcomeMessage. I am using password based authentication and once the authentication is succeeded , it triggers the ServerOnShellCommand event with SH command and then this event is never trigerred for any client input until I close the client session. I want to process and send response for client input entered line by line.

Can you please tell the reason behind this behavior and how to overcome it?

Thanks in advance!

Applies to: File Server

1 Answer

0 votes
answered Jan 25 by Lukas Pokorny (94,310 points)

ShellPrompt is not used in terminal-less mode because that's how SSH servers on most operating systems behave. On the other hand, they apparently do send a welcome message, so the lack of ShellWelcomeMessage appears to be an omission. We will fix this for the next release.

The ServerOnShellCommand event is not triggered for user input, but only for commands issued through the shell. We'll look into it to make sure this works properly in pseudoterminal-less mode. However, if you need to handle user input line-by-line or even character-by-character, you can now use the commands's SshConsole to gain access to its stdin/stdout/stderr streams, as demonstrated in this advanced sample.

commented Jan 25 by sd (170 points)
Hi

I tried with SshConsole to process user input line by line in ServerOnShellCommand event when I receive "SH" command text.
1. However is there any way by which I can distinguish if the connection to server is initiated with or without pseudo terminal allocation configuration ? Based on that I can customize the action. because I need to handle custom prompt, welcome message, formatting on own when terminal less request is made.

2. We're evaluating Rebex fileServer and until now it seems to be fulfilling our requirements. However, you mentioned to fix the issue with lack of ShellWelcomeMessage , ServerOnShellCommand event triggering when terminal less connection is requested , can you please tell by when and in which release will you be fixing these issues? This will help us.

Thanks again!
commented Jan 30 by Lukas Pokorny (94,310 points)
The issue with ShellCommand not getting called indeed turned out to be a bug. It will be fixed in the next release.

The next version will also make it possible to specify whether the welcome message is to be shown for terminal-less shells.

It will also be possible to use SshConsole.HasPseudoTerminal property to determine whether running with a pseudo-terminal or not.

I have sent a link to a hotfix builds (includes all of the above) to your e-mail.
commented Apr 6 by Lukas Pokorny (94,310 points)
The hotfix made it into Rebex File Server 2018 R1: https://www.rebex.net/file-server/history.aspx#2018R1
...