I'm a system engineer and not a developer so forgive me if my code is garbage. I'm making some baby steps in changing some of your examples to connect to a test Solaris 10 server I have and here's the problem that occurring:
I can log into the server but I don't get a prompt until after I hit enter. Any commands I enter come up blank until I hit return a second time - example: ls <enter> returns nothing <enter> again returns the ls contents.
Below is the code I'm using which is basically a copy of your sshexetext.cs. I can send a screenshot if needed.
Thanks for your time and efforts on this issue and your project.
JT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tamir.SharpSsh;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string Host = "xxxxxxxxxx";
string User = "xxxxxxxxxxxx";
string Pass = "xxxxxxxxxxxx";
try
{
Console.Write("-Connecting...\n");
SshStream ssh = new SshStream(Host, User, Pass);
Console.WriteLine("OK ({0}/{1})", ssh.Cipher, ssh.Mac);
Console.WriteLine("Server version={0}, Client version={1}", ssh.ServerVersion, ssh.ClientVersion);
Console.WriteLine("-Use the 'exit' command to disconnect.");
Console.WriteLine();
//ssh.Prompt = "#"; <----- This also caused this app to lockup
//Remove terminal emulation characters
ssh.RemoveTerminalEmulationCharacters = true;
Console.Write(ssh.ReadResponse());
while (true)
{
string command = Console.ReadLine();
if (command.ToLower().Equals("exit"))
break;
I'm a system engineer and not a developer so forgive me if my code is garbage. I'm making some baby steps in changing some of your examples to connect to a test Solaris 10 server I have and here's the problem that occurring:
I can log into the server but I don't get a prompt until after I hit enter. Any commands I enter come up blank until I hit return a second time - example: ls <enter> returns nothing <enter> again returns the ls contents.
Below is the code I'm using which is basically a copy of your sshexetext.cs. I can send a screenshot if needed.
Thanks for your time and efforts on this issue and your project.
JT
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tamir.SharpSsh;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
string Host = "xxxxxxxxxx";
string User = "xxxxxxxxxxxx";
string Pass = "xxxxxxxxxxxx";
try
{
Console.Write("-Connecting...\n");
SshStream ssh = new SshStream(Host, User, Pass);
Console.WriteLine("OK ({0}/{1})", ssh.Cipher, ssh.Mac);
Console.WriteLine("Server version={0}, Client version={1}", ssh.ServerVersion, ssh.ClientVersion);
Console.WriteLine("-Use the 'exit' command to disconnect.");
Console.WriteLine();
//ssh.Prompt = "#"; <----- This also caused this app to lockup
//Remove terminal emulation characters
ssh.RemoveTerminalEmulationCharacters = true;
Console.Write(ssh.ReadResponse());
while (true)
{
string command = Console.ReadLine();
if (command.ToLower().Equals("exit"))
break;
ssh.Write(command);
Console.Write(ssh.ReadResponse());
}
ssh.Close(); //Close the connection
Console.WriteLine("Connection closed.");
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}