Quantcast
Channel: SSH.NET Library
Viewing all 2955 articles
Browse latest View live

Commented Unassigned: various System.ObjectDisposedException [1944]

$
0
0
during a long connection I get following exceptions:

```
System.ObjectDisposedException: Das SafeHandle wurde geschlossen.
bei Renci.SshNet.Session.WaitHandle(WaitHandle waitHandle) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Session.cs:Zeile 642.
bei Renci.SshNet.Channels.Channel.WaitHandle(WaitHandle waitHandle) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Channels\Channel.cs:Zeile 496.
bei Renci.SshNet.Channels.ChannelSession.Open() in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Channels\ChannelSession.cs:Zeile 52.
bei Renci.SshNet.ShellStream..ctor(Session session, String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, Int32 maxLines, IDictionary`2 terminalModeValues) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\ShellStream.cs:Zeile 73.
bei Renci.SshNet.SshClient.CreateShellStream(String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, Int32 bufferSize, IDictionary`2 terminalModeValues) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\SshClient.cs:Zeile 384.
bei Renci.SshNet.SshClient.CreateShellStream(String terminalName, UInt32 columns, UInt32 rows, UInt32 width, UInt32 height, Int32 bufferSize) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\SshClient.cs:Zeile 366.
```

and

```
System.ObjectDisposedException: Das SafeHandle wurde geschlossen.
bei System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
bei Microsoft.Win32.Win32Native.SetEvent(SafeWaitHandle handle)
bei System.Threading.EventWaitHandle.Set()
bei Renci.SshNet.ShellStream.Channel_DataReceived(Object sender, ChannelDataEventArgs e) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\ShellStream.cs:Zeile 739.
bei Renci.SshNet.Channels.Channel.OnData(Byte[] data) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Channels\Channel.cs:Zeile 289.
bei Renci.SshNet.Channels.Channel.OnChannelData(Object sender, MessageEventArgs`1 e) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Channels\Channel.cs:Zeile 590.
bei System.EventHandler`1.Invoke(Object sender, TEventArgs e)
bei Renci.SshNet.Session.OnChannelDataReceived(ChannelDataMessage message) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Session.cs:Zeile 1392.
bei Renci.SshNet.Session.HandleMessage(ChannelDataMessage message) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Session.cs:Zeile 1034.
bei CallSite.Target(Closure , CallSite , Session , Object )
bei Renci.SshNet.Session.HandleMessageCore(Message message) in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Session.NET40.cs:Zeile 20.
bei Renci.SshNet.Session.MessageListener() in c:\Users\srinkes\Desktop\Projects\XXX\Renci.SshNet\Session.cs:Zeile 1589.
```

The application opens a ssh connection and opens/parses a ShellStream every 10 seconds.
IsConnected stays true.

I currently can't test the current beta since it has issues with closing the channel after
disposing the ShellStream.

No errors or unusual log entries on the server side.
Comments: ** Comment from web user: da_rinkes **

Awesome! Looking forward to the commit.


New Post: Slow failure reading non-existing file using SCP

$
0
0
Hi,

Thanks for having a look. Interesting. The 'server' is a proprietary Linux device we manufacture. I need to investigate further.

The way you use the ScpClient is different to my implementation, I wonder if I'm using it wrong. Here is a code frag of my code:
            using (var stream = new MemoryStream((128 * 1024)))
            {
                var hasError = false;
                using (var scpClient = new ScpClient(XXX.IpAddress, XXX.UserName, XXX.Password))
                {
                    scpClient.ErrorOccurred += (x, y) => hasError = true;
                    scpClient.BufferSize = BufferSize;

                    scpClient.Connect();

                    if (scpClient.IsConnected && !hasError)
                    {
                        try
                        {
                            scpClient.Download(_sourcePath, stream);
                        }
                        catch (ScpException exception)
                        {
                            // logging stuff here ... do get the "file or directory not found".
                        }

                        scpClient.Disconnect();
                    }
                }

                // consume stream here as 'stream.ToArray()'
            }

New Post: Slow failure reading non-existing file using SCP

$
0
0
Sorry I did not answer your question about the server properly. It is a Linux box using SSH-2.0-dropbear_0.49

Thx

Rob

New Post: Slow failure reading non-existing file using SCP

$
0
0
Thanks,

I have confirmed that the 3 second delay is on the server end, nothing to do with SSH.NET.

Thanks for your help

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

__var failedAuthenticationMethods = new List<AuthenticationMethod>();__

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: da_rinkes **

no, no! do not change the code in library

I usually do:
```
_client = new SshClient(res.host, int.Parse(res.port), res.user, res.password);
try
{
_client.Connect();
}
catch (Exception exception)
{
Console.WriteLine(exception);
}
```

Instead of Console.WriteLine you can ask for the password again.
Exceptions are the way SSH.NET reports errors, which is a common way in .Net libraries.

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

Ya that works well but , if only password is not correct I should display message password is mismatching
or authentication failed due to wrong password.

How to solve this.

Thanks for your immediate response and precious time.

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

I have another issue, how can I send file from my windows machine to remote unix/linux box.

So that I can add a command in my application to Upload/Download.

Thanks,
Avinash


Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: da_rinkes **

If I understand you correctly, you can try this:

```
_client = new SshClient(res.host, int.Parse(res.port), res.user, res.password);
try
{
_client.Connect();
}
catch (SshAuthenticationException authexception)
{
// Auth failed, reask credentials
}
catch (Exception exception)
{
// general Error Occured, e.g. host unreachable
}
```

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: da_rinkes **

drieseng: i think you can close this issue, since its not a problem with SSH.NET and should have been a discussion :)

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

Super Thanks man, You got it right :) Awesome.


And how to solve this:

I have another issue, how can I send file from my windows machine to remote unix/linux box and vice versa.

So that I can add a command in my application to Upload/Download.

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: da_rinkes **

Please open a discussion for it. Issues should be used for problems/bugs.
You have general questions.

Read the docs https://sshnet.codeplex.com/documentation and then open a discussion with your
questions/problems.

Just a hint: SFTP. The rest is up to you, else I feel like i should be payed for doing your job :)

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

Hi sorry for bugging you,


I am using :

client = new SshClient(res.host, int.Parse(res.port), res.user, res.password);
_client.connect();

in __FORM1__

after successful authentication I want to execute commands in __FORM2:__

Just like : _client.RunCommand("touch newfile1");


but the error is sshclient is not present in this form.

my question how to maintain a __single authentication through out different forms__.

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

Oh thank you thanks allot, Sorry to bug you :)

New Post: Maintain connection through different forms

$
0
0
I am using :

client = new SshClient(res.host, int.Parse(res.port), res.user, res.password);
_client.connect();

in FORM1

after successful authentication I want to execute commands in FORM2:

Just like : _client.RunCommand("touch newfile1");


but the error is sshclient is not present in this form.

my question how to maintain a single authentication through out different forms.

Commented Unassigned: SsHAuthenticationException Unhandelled [1960]

$
0
0
Hi,

I am creating a C# application that executes Linux command remotely.

Everything is fine with SSH.NET.

But when I enter wrong password it is not giving proper ERROR, just exception un-handed is the message that I am getting, and also "__No suitable authentication method found to complete authentication__."

But i just want to pop-up with a messagbox that re-enter user, something like that how can I overcome this.


Thanks & Regards
Avinash.
Comments: ** Comment from web user: avinashav **

How to close the ticket.

New Post: Missing file from 2014.4.6-beta1 source

$
0
0
I downloaded the latest release, 2014.4.6-beta1, source and tried to compile but am missing the Renci.SshNet.snk file from the project. What is this file and how can I go about getting it?

New Post: Missing file from 2014.4.6-beta1 source

$
0
0
This file contains the key to sign the assembly.
You can't get it (hopefully :)).

Open the Properties of the project in VisualStudio and uncheck the "Sign the assembly" checkbox.
Now you can build your own version of the library.

Created Unassigned: Maintain connection through different forms [1961]

$
0
0
I am using :

client = new SshClient(res.host, int.Parse(res.port), res.user, res.password);
_client.connect();

in __FORM1__

after successful authentication I want to execute commands in __FORM2__:

Just like : _client.RunCommand("touch newfile1");


but the error is sshclient is not present in this form.

my question how to maintain a __single authentication through out different forms.__

Source code checked in, #35430

$
0
0
Removed a few conditions from IsSocketConnected that have been moved to IsConnected. Fixed a few warnings.
Viewing all 2955 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>