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

Closed Unassigned: Unable to connect to : Exception calling "Connect" with "0" argument(s): "No suitable authentication method found to complete authentication." [1871]

$
0
0
Hello,

After doing Import-Module SSH-Sessions, I try to connect as follows:

PS C:> New-SshSession -ComputerName 10.220.12.220 -Username username -Password ***********
Unable to connect to 10.220.12.220: Exception calling "Connect" with "0" argument(s): "No suitable authentication method found to complete authentication."

I can to it connect using putty. The putty log shows me this (hoe this helps):

2014-01-16 06:53:21 Looking up host "10.220.12.220"
2014-01-16 06:53:21 Connecting to 10.220.12.220 port 22
2014-01-16 06:53:21 Server version: SSH-2.0-OpenSSH_4.2
2014-01-16 06:53:21 Using SSH protocol version 2
2014-01-16 06:53:21 We claim version: SSH-2.0-PuTTY_Snapshot_2010_05_02:r8934
2014-01-16 06:53:21 Doing Diffie-Hellman group exchange
2014-01-16 06:53:21 Doing Diffie-Hellman key exchange with hash SHA-1
2014-01-16 06:53:23 Host key fingerprint is:
2014-01-16 06:53:23 ssh-rsa 2048 <some hex string>
2014-01-16 06:53:23 Initialised AES-256 CBC client->server encryption
2014-01-16 06:53:23 Initialised HMAC-SHA1 client->server MAC algorithm
2014-01-16 06:53:23 Initialised AES-256 CBC server->client encryption
2014-01-16 06:53:23 Initialised HMAC-SHA1 server->client MAC algorithm
2014-01-16 06:53:40 Access granted
2014-01-16 06:53:40 Opened channel for session
2014-01-16 06:53:40 Allocated pty (ospeed 38400bps, ispeed 38400bps)
2014-01-16 06:53:40 Started a shell/command
Comments: This is not an issue in SSH.NET.
If you need more assistance, then open a discussion thread.

Closed Unassigned: Crash while handling SSH_MSG_CHANNEL_CLOSE message [2538]

$
0
0
The application crashed. Crash dump analysis indicate a possible race condition
at handling SSH_MSG_CHANNEL_CLOSE message.

2014-10-12 01:05:44,805 FATAL
System.NullReferenceException: Object reference not set to an instance of an object.
at Renci.SshNet.Sftp.SubsystemSession.RaiseError(Exception error)
at Renci.SshNet.Sftp.SubsystemSession.Session_ErrorOccured(Object sender, ExceptionEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Renci.SshNet.Session.RaiseError(Exception exp)
at Renci.SshNet.Session.MessageListener()
at Renci.SshNet.Session.<Connect>b__17()
at Renci.SshNet.Session.<>c__DisplayClass3.<ExecuteThread>b__2(Object o)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
Comments: Don't hesitate to reopen this issue if you can still reproduce it with 2014.4.6-beta1 or later.

Commented Unassigned: Unable to execute the commands with "sudo" on CentOS-OpneLogic [2279]

$
0
0
Hi,

I was trying to access and execute the commands on remote Linux machine of CentOs-OpenLogic. But while executing the commands with sudo option, i was getting error like tty required. My code is as follows:

New-SshSessions -ComputerName <name.cloudapp.net> -Username <name> -Keyfile <path to key file>
nvoke-SshCommand -ComputerName <name.cloudapp.net> -Command "sudo mkdir testfolder"
Remove-Sshsession

The error is "sudo: sorry, you must have a tty to run sudo", but the same script is working for Ubuntu OS. I was unable to figure out what exactly the problem was.

It is an urgent issue, please anyone help me on this.

Thanks and Regards,
Bhaskar D
Comments: ** Comment from web user: drieseng **

This is not a SSH.NET issue, but you can find a solution here:
http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password

Closed Unassigned: Unable to execute the commands with "sudo" on CentOS-OpneLogic [2279]

$
0
0
Hi,

I was trying to access and execute the commands on remote Linux machine of CentOs-OpenLogic. But while executing the commands with sudo option, i was getting error like tty required. My code is as follows:

New-SshSessions -ComputerName <name.cloudapp.net> -Username <name> -Keyfile <path to key file>
nvoke-SshCommand -ComputerName <name.cloudapp.net> -Command "sudo mkdir testfolder"
Remove-Sshsession

The error is "sudo: sorry, you must have a tty to run sudo", but the same script is working for Ubuntu OS. I was unable to figure out what exactly the problem was.

It is an urgent issue, please anyone help me on this.

Thanks and Regards,
Bhaskar D
Comments: Not a SSH.NET issue, but solution provided.

Commented Issue: ZeroBytes in ShellStream [1525]

$
0
0
Somethimes in a shellstream there can be zero bytes found.
It was gone after the update in 12/2012 and appiert back
with the update in ~02/2013.

In the buffer i can find then lots of zero bytes, some text of the last read
and some of the new text. So the data without the zerobytes is currupt.

After the first accur the following reads will be damaged too.

Only after a reconnect the behaivor is gone.

I think, it is a miss callculatat index or buffer size on a buffer-resize situation.

Sould i try it, too fix it be myself?

Initialize Code:

var keyFile = new PrivateKeyFile(privateKey, passPhrase);
var connectionInfo = new PrivateKeyConnectionInfo(host, port, userName, keyFile);

var client = new SshClient(connectionInfo);

client.Connect();

var stream = client.CreateShellStream("", 80, 24, 800, 600, 1024);
Comments: ** Comment from web user: drieseng **

I failed to reproduce this issue, and also couldn't find a an explanation in our code.
Can you still reproduce this issue with the latest beta release (or SSH.NET built from TFS/SVN) ?

Source code checked in, #40626

$
0
0
Fix exception documentation for BaseClient.Connect() and Session.Connect(). Added SftpPathNotFoundException to doc for SftpClient.Get(String) and SftpClient.GetAttributes(String). Do not throw exception in Session.Disconnect() and Session.Dispose() when socket is not connected. Fixes issue #2148.

Edited Issue: SftpClient is throwing undocumented exceptions [2148]

$
0
0
The documentation says that Connect can throw InvalidOperationException and ObjectDisposedException, but when you can't connect (remote server stopped, network problem, ...) a SocketException is thrown after a long timeout (about 10 seconds).

Worst, if you catch the exception and log the error another SocketException is thrown when you call Dispose. Documentation doesn't list any exceptions for Dispose.

Closed Issue: SftpClient is throwing undocumented exceptions [2148]

$
0
0
The documentation says that Connect can throw InvalidOperationException and ObjectDisposedException, but when you can't connect (remote server stopped, network problem, ...) a SocketException is thrown after a long timeout (about 10 seconds).

Worst, if you catch the exception and log the error another SocketException is thrown when you call Dispose. Documentation doesn't list any exceptions for Dispose.
Comments: Fixes in changeset 40626:

Fix exception documentation for BaseClient.Connect() and Session.Connect().
Added SftpPathNotFoundException to doc for SftpClient.Get(String) and SftpClient.GetAttributes(String).
Do not throw exception in Session.Disconnect() and Session.Dispose() when socket is not connected.

Source code checked in, #40627

$
0
0
Document exceptions for ConnectionInfo constructors. Improve exception messages for argument checks. Only perform null argument check for hosts. Fixes issue #1845.

Closed Issue: SftpClient ctor throws exception when hostname has _ character [1845]

$
0
0
The constructor for SftpClient and SshClient class throws an ArgumentException when the hostname has an underscrore character '_' . Using disassembly I can find the issue is the regex _rehost in Extensions.cs

This regex should be fixed as _ is valid hostname.
Comments: Fixed in changeset 40627.
We now only perform null check against host arguments.

Source code checked in, #40628

Source code checked in, #40629

$
0
0
Make internal methods available to castle proxies.

Source code checked in, #40630

$
0
0
Added SftpClientTest.Connect.cs to test project for .NET 3.5. Do not use TPL to allow tests to work on .NET 3.5.

Closed Unassigned: System.ObjectDisposedException at Renci.SshNet.Channels.ChannelDirectTcpip.OnErrorOccured [1942]

$
0
0
Hello,

I have been using the SSH.Net library to connect to a remote SSH server to establish a DB connection between a VB client software and MySQL server. Everything works fine except sometimes the following exception is unhandled and crashes the application:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.ObjectDisposedException
Stack:
at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean ByRef)
at Microsoft.Win32.Win32Native.SetEvent(Microsoft.Win32.SafeHandles.SafeWaitHandle)
at System.Threading.EventWaitHandle.Set()
at Renci.SshNet.Channels.ChannelDirectTcpip.OnErrorOccured(System.Exception)
at Renci.SshNet.Channels.Channel.Session_ErrorOccured(System.Object, Renci.SshNet.Common.ExceptionEventArgs)
at System.EventHandler`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Invoke(System.Object, System.__Canon)
at Renci.SshNet.Session.RaiseError(System.Exception)
at Renci.SshNet.Session.MessageListener()
at Renci.SshNet.Session.<Connect>b__4()
at Renci.SshNet.Session+<>c__DisplayClass3d.<ExecuteThread>b__3c(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

I am running with the code base downloaded on March 16th 2014.

My connect, disconnect code is pretty straightforward:

client = Nothing
client = New SshNet.SshClient(_host, _port, _user, key)
client.Connect()
portfw = Nothing
portfw = New SshNet.ForwardedPortLocal("localhost", 33306, "localhost", 3306)
client.AddForwardedPort(portfw)
portfw.Start()
...................
If isStarted Then
portfw.Stop()
End If
If isConnected Then
client.RemoveForwardedPort(portfw)
client.Disconnect()
End If


I looked through the issues list and it seems very similar to issue #1840 behaviour...

This seems to happen when the SshNet.SshClient is set to Nothing and disposed, i.e., Create SshClient, connect, create portFW, start, do some operations, stop portFW, remove portFW, disconnect SshClient, Set SshClient to Nothing.

Sometimes, this will result in the exception above.

Many thanks and cheers,

Phil
Comments: Discussed this offline with Phil, and he agreed to close this issue.

Edited Issue: SNK issue when trying to build [2455]

$
0
0
I just downloaded this SSH.NET Library. I added it to a new visual studio project and tried to build. There's no code in my "main" project, this is just trying to build the solution and I keep getting an issue:

Error 13 Cryptographic failure while signing assembly 'blahblah\Renci.SshNet.dll' -- 'Error reading key file 'blahblah\Renci.SshNet.snk' -- The system cannot find the file specified. ' blahblah\Renci.SshNet\CSC Renci.SshNet

There's no .snk file in the zip or in the directory in windows explorer. I see it in the visual studio explorer with a question mark around it.

How am I supposed to get past this issue to use this library?

Source code checked in, #40631

$
0
0
Include signing key in source download. Fixes issue #2455.

Edited Issue: SNK issue when trying to build [2455]

$
0
0
I just downloaded this SSH.NET Library. I added it to a new visual studio project and tried to build. There's no code in my "main" project, this is just trying to build the solution and I keep getting an issue:

Error 13 Cryptographic failure while signing assembly 'blahblah\Renci.SshNet.dll' -- 'Error reading key file 'blahblah\Renci.SshNet.snk' -- The system cannot find the file specified. ' blahblah\Renci.SshNet\CSC Renci.SshNet

There's no .snk file in the zip or in the directory in windows explorer. I see it in the visual studio explorer with a question mark around it.

How am I supposed to get past this issue to use this library?
Comments: ** Comment from web user: drieseng **

Fixed in changeset 40631.

Commented Unassigned: An established connection was aborted by the server [2398]

$
0
0
When trying to download files from sftp, I am getting error:"__An established connection was aborted by the server__"
Comments: ** Comment from web user: jmf **

Sorry for the delay in responding. I've been out on vacation.

I was using the beta release from April 6, 2014 that is available on CodePlex. Due to time constraints, I had to switch to another library (Rebex). After switching I no longer experience the error when attempting to read larger files. Unfortunately, I didn't keep the code that was experiencing this error after I switched to the new library. I'll come back to this as soon as I can, but right now I have some deadlines to meet.

Thanks!

Created Unassigned: BlockCipher.Encrypt fails if input message is not padded [2547]

$
0
0
BlockCipher.Encrypt fails if input message length is not a multiple of BlockSize. The error is "Invalid output buffer".

This seems to be due to the following code in EncryptBlock function of BlockCipher class:

var output = new byte[data.Length];

if (data.Length % this._blockSize > 0)
{
if (this._padding == null)
{
throw new ArgumentException("data");
}
data = this._padding.Pad(this._blockSize, data);
}

The size of output array is determined before the padding of input data. As a result, after the padding input array is longer than output array.

The same applies to Decrypt function.

Source code checked in, #40665

$
0
0
Modify accessiblity of Authenticate to internal, and modify IsAuthenticated depending on the outcome of the authentication.
Viewing all 2955 articles
Browse latest View live


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