EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SSH Shelless

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#10443
Posted: 06/22/2009 09:08:18
by Peter Schenk (Basic support level)
Joined: 06/22/2009
Posts: 5

Hi,
I recently downloaded the .net version of SecureBlackBox and was wondering if it’s possible to do a SSH with no command shell?

We have a simple forms GUI that is currently using the following code to use a command link utility “PLINK.EXE” to send a command to the debian client. The problem is that it leaves the command prompt open even with all the switched applied. This works OK for now but I would like to update the code and use this product if it can do what we need to.

Here is the current code in c#

string stfamtv0001 = "/C" + ("\"\"PLINK.EXE\"" + " " + "appliance@%ThinConnectedFrom%" + " " + "-pw appliance" + " " + "\" killall -q vlc; export DISPLAY=:0.0; vlc --volume 512 rtsp://stfamtv0001/streama\"\"");

private void data(string streamPath)
{
System.Diagnostics.Process ps;
ps = new System.Diagnostics.Process();
ps.EnableRaisingEvents = false;
System.Diagnostics.Process.Start("CMD.exe", streamPath);
ps.Close();
}

private void foxNewsToolStripMenuItem_Click(object sender, EventArgs e)
{
data(stfamtv0001);
}

Do you have any examples where I can tweak the code?

Thanks

Peter
#10446
Posted: 06/22/2009 09:19:41
by Eugene Mayevski (EldoS Corp.)

Please explain what you need to do without mentioning plink: plink is a tool which you use to accomplish ... what?


Sincerely yours
Eugene Mayevski
#10450
Posted: 06/22/2009 10:19:54
by Peter Schenk (Basic support level)
Joined: 06/22/2009
Posts: 5

Plink is a SSH program that has command line arugments that allow us to pass the following commands in a command prompt "appliance@%ThinConnectedFrom%" + " " + "-pw appliance".

I need to be able to run the same command with your product without a CMD.EXE shell.
#10451
Posted: 06/22/2009 10:28:09
by Eugene Mayevski (EldoS Corp.)

You can use ElSimpleSSHClient component and set it's Command property to the command that needs to be executed. The command will be executed on the server and then you'll get the resulting data and the connection will be closed automatically.


Sincerely yours
Eugene Mayevski
#10452
Posted: 06/22/2009 10:31:33
by Peter Schenk (Basic support level)
Joined: 06/22/2009
Posts: 5

Already did that but the GUI shows up, i need to be able run the command with NO GUI and NO Client showing.
#10455
Posted: 06/22/2009 13:31:31
by Eugene Mayevski (EldoS Corp.)

Are you talking about some GUI on the server side? The exact behavior on the server side depends on the server software settings. I don't know what GUI appears if the server must run the console process (i.e. you should get a console window, not a GUI). What you can do is set RequestTerminal property to false. This should suppress the remote terminal.


Sincerely yours
Eugene Mayevski
#10495
Posted: 06/29/2009 06:34:15
by Peter Schenk (Basic support level)
Joined: 06/22/2009
Posts: 5

Your example of the ElSimpleSSHClient uses a GUI to initiate the command, what I need is an example of lSimpleSSHClient initiating the command string above without showing a GUI.
#10496
Posted: 06/29/2009 06:47:41
by Eugene Mayevski (EldoS Corp.)

sshclient.Command = "yourcommand";
sshclient.Open();

try
{
while (sshclient.Active || sshclient.CanReceive(100))
{
sshclient.ReceiveData(...);
if (!sshclient.Active)
break;
}
}
except()
{
// suppress or handle possible exceptions
}

sshclient.Close;


that's all. The rest is your job.


Sincerely yours
Eugene Mayevski
#10501
Posted: 06/29/2009 07:39:23
by Eugene Mayevski (EldoS Corp.)

Forgot to mention - you MUST handle OnKeyValidate event and properly validate the key, sent to you by the server. Without doing this your security is weak and useless.


Sincerely yours
Eugene Mayevski
#10529
Posted: 07/06/2009 12:16:23
by Peter Schenk (Basic support level)
Joined: 06/22/2009
Posts: 5

How can i modify this program to do what i need/

C:\Program Files\EldoS\SecureBlackbox.NET\Samples\C#\SSHBlackbox\Client\SimpleSSHClient
Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.

Reply

Statistics

Topic viewed 3168 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!