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

Source code checked in, #22965

$
0
0
Commiting files that were not commited on previous commit

New Post: Small File Upload Problem

$
0
0
It is not my server so I will need to request it. Let me see if IPSWITCH has a demo version of their server as well.

Rich

New Post: Testing can destroy your home

$
0
0
Yea,
I can look into putting it into different folder probably.
Well, originally I was not planning for anybody to use those test except for developers
So I guess next time I am looking at test I will do those changes.
If yo don't mine, can you open it as a Issue so I don't forget about it?

Thanks,
Oleg

New Post: Small File Upload Problem

$
0
0
ok,
Thanks,
Yea let me know if it does and where to get it, I could install it then on one of VMs here.

Thanks,
Oleg

Created Issue: Test initialization should not delete all files in the given test path [1504]

$
0
0
Test method OnInit() cleans up the entire destination path with "rm -rf *"

On inadvertent use, this will cause complete data loss on the given destination path (whole home directories can be deleted).

One simple solution would be to use an additional subdirectory for tests and empty _that directory only_ in the OnInit() method.

New Post: Testing can destroy your home

$
0
0
I have created an issue.

Thanks Oleg and best regards!

New Post: 3.5 Source Code for release 2013.1.8?

$
0
0
Hey Matt,

Thanks a lot for pointing this out.

Regards,

Elson

Created Issue: Correct casing of Security/Cryptography/HMAC.cs [1505]

$
0
0
I've just tried to compile the library on Mono/Linux, it builds, however with one glitch. The mentioned file is named HMAC.cs, but is referenced as Security/Cryptography/HMac.cs, so either reference or the file should be changed to both to be consistent. Otherwise builds and works fine, thanks for the lib.

Created Issue: Swedish characters displayed incorrectly in uploaded filenames [1506]

$
0
0
Hi,

I am using revision 23009 (currently the latest on trunk). If I upload a file through SSH (UploadFile) containing one of the three Swedish characters the filename written to the remote server is incorrect. It seems the SSH .NET library can't cope with the encoding somehow? I am using .NET framework v3.5.

For example "Västmanland.txt" get displayed as "Västmanland.txt".

Thanks,
Regards
Jan

Commented Issue: Swedish characters displayed incorrectly in uploaded filenames [1506]

$
0
0
Hi,

I am using revision 23009 (currently the latest on trunk). If I upload a file through SSH (UploadFile) containing one of the three Swedish characters the filename written to the remote server is incorrect. It seems the SSH .NET library can't cope with the encoding somehow? I am using .NET framework v3.5.

For example "Västmanland.txt" get displayed as "Västmanland.txt".

Thanks,
Regards
Jan
Comments: ** Comment from web user: janisito **

The solution is to change the encoding on the connectionInfo to ISO-8859-1. Not a bug.

Thx,
Regards
Jan

Closed Issue: Swedish characters displayed incorrectly in uploaded filenames [1506]

$
0
0
Hi,

I am using revision 23009 (currently the latest on trunk). If I upload a file through SSH (UploadFile) containing one of the three Swedish characters the filename written to the remote server is incorrect. It seems the SSH .NET library can't cope with the encoding somehow? I am using .NET framework v3.5.

For example "Västmanland.txt" get displayed as "Västmanland.txt".

Thanks,
Regards
Jan
Comments: Not an issue

Closed Issue: SshClient and SftpClient hang on server terminate [1439]

$
0
0
Hi there
My app uses both SftpClient and SshClient on threadpool threads, to interact with a remote server (specifically OpenSSH running on Amazon AWS EC2 servers running Windows).

Because these AWS servers go down more than I'd like, I've had to build in retry-logic into my code. This retry logic looks for certain exceptions from SftpClient and SshClient, and if one occurs, waits for a timeout period, and tries again.

The problem I'm running into is that once one of these servers terminates (and thus there is no remote SSH server that can be connected to), occasionally both the SftpClient.Connect and the SshClient.Connect calls will hang (never return).

Sometimes they don't hang, though, they do the expected thing which is to throw an exception.

I can't figure out why sometimes they hang and never return.

Any insights, or suggestions for how to debug this, would be greatly appreciated

Michael
Comments: No response, assume it is fixed

New Post: Mono Support?

$
0
0
I see Mono support is listed but I am not able to get this code to execute correct via Mono.

Here is the code I am running:
            using (SshClient ssh = new SshClient(host,username,password))
            {
                try {
                    ssh.Connect();

                    var cmd = ssh.CreateCommand("ls -l");   //  very long list
                    var asynch = cmd.BeginExecute(delegate(IAsyncResult ar)
                                                  {
                        Console.WriteLine("Finished.");
                    }, null);
                    
                    var reader = new StreamReader(cmd.OutputStream);
                    
                    while (!asynch.IsCompleted)
                    {
                        var result = reader.ReadToEnd();
                        if (string.IsNullOrEmpty(result))
                            continue;
                        Console.Write(result);

                    }
                    cmd.EndExecute(asynch);
                }
                catch (Exception ex){
                    Console.WriteLine (ex.Message + Environment.NewLine + ex.StackTrace);

                }
            }
Here are the results:

No suitable authentication method found to complete authentication.
at Renci.SshNet.ConnectionInfo.Authenticate (Renci.SshNet.Session session) [0x0009f] in .../Renci.SshNet/ConnectionInfo.cs:413
at Renci.SshNet.Session.Connect () [0x00322] in .../Renci.SshNet/Session.cs:558
at Renci.SshNet.BaseClient.Connect () [0x0005b] in .../Renci.SshNet/BaseClient.cs:117
at SSH_TEST.MainClass.Main (System.String[] args) [0x0001b] in .../SSH_TEST/Main.cs:21


Has anyone been able to compile and execute the Renci.SshNet solution via MonoDevelop in OSX?

This same code runs just fine in VS2010...

New Post: SCP copy to a specific folder

$
0
0
Hi,

I have the same problem as journo, where im getting folowing error: "scp: : No such file or directory", but i cant find your latest committed code, 22896, where can i find it?

Thanks

Created Issue: Invalid handling of http proxy server response [1509]

$
0
0
Hi,

I did find a problem when testing the assembly with our squid 3.0 proxy. I receive the message, that Result cannot be called on a failed match. Therefore I've extended the code in Session.cs a little bit:

if (statusCode == 200 && string.IsNullOrEmpty(response))
{
// Once all HTTP header information is read, exit
break;
}
else
{
string reasonPhrase = string.Empty;

try
{
if (match.Success)
reasonPhrase = match.Result("${reasonPhrase}");
}
catch (Exception ex)
{
reasonPhrase = string.Empty;
}

Now the following line

throw new ProxyException(string.Format("HTTP: Status code {0}, Reason \"{1}\"", statusCode, reasonPhrase));

Does at least return the error code (not yet the fault reason; in this case ERR_ACCESS_DENIED)

In fact the code received a 403 status code from the proxy:

SshNet.Logging Verbose: 1 : Initiating connect to 'yyy.xxx.zzz.ww:22'.

HTTP/1.0 403 Forbidden
Server: squid/3.0.STABLE16-RC1
Mime-Version: 1.0
Date: Wed, 13 Feb 2013 14:15:06 GMT
Content-Type: text/html
Content-Length: 1008
Expires: Wed, 13 Feb 2013 14:15:06 GMT
X-Squid-Error: ERR_ACCESS_DENIED 0
X-Cache: MISS from app-proxy-3.xxxx.xxx
Via: 1.0 app-proxy-3.xxxx.xxx (squid/3.0.STABLE16-RC1)
Proxy-Connection: close

The thread 0xa2c has exited with code 0 (0x0).

Kind regards

Johannes

New Post: SCP copy to a specific folder

$
0
0
Hi,

You simply need to download it from "SOURCE CODE" tab above.

Thanks,
Oleg

New Post: Mono Support?

$
0
0
Hi,

Unfortunatly I wont be able to help you with mono part. I have people who compiled and used it on Mono so may be they will be able to help you with that.
Usually "No suitable authentication method found to complete authentication" message means that you need to use password authentication instead of private key, or private key instead password, may be even keyboard interactive etc'.
I would just try different authentication method and see if it works.

Hope it helps,
Thanks,
Oleg

Commented Issue: Invalid handling of http proxy server response [1509]

$
0
0
Hi,

I did find a problem when testing the assembly with our squid 3.0 proxy. I receive the message, that Result cannot be called on a failed match. Therefore I've extended the code in Session.cs a little bit:

if (statusCode == 200 && string.IsNullOrEmpty(response))
{
// Once all HTTP header information is read, exit
break;
}
else
{
string reasonPhrase = string.Empty;

try
{
if (match.Success)
reasonPhrase = match.Result("${reasonPhrase}");
}
catch (Exception ex)
{
reasonPhrase = string.Empty;
}

Now the following line

throw new ProxyException(string.Format("HTTP: Status code {0}, Reason \"{1}\"", statusCode, reasonPhrase));

Does at least return the error code (not yet the fault reason; in this case ERR_ACCESS_DENIED)

In fact the code received a 403 status code from the proxy:

SshNet.Logging Verbose: 1 : Initiating connect to 'yyy.xxx.zzz.ww:22'.

HTTP/1.0 403 Forbidden
Server: squid/3.0.STABLE16-RC1
Mime-Version: 1.0
Date: Wed, 13 Feb 2013 14:15:06 GMT
Content-Type: text/html
Content-Length: 1008
Expires: Wed, 13 Feb 2013 14:15:06 GMT
X-Squid-Error: ERR_ACCESS_DENIED 0
X-Cache: MISS from app-proxy-3.xxxx.xxx
Via: 1.0 app-proxy-3.xxxx.xxx (squid/3.0.STABLE16-RC1)
Proxy-Connection: close

The thread 0xa2c has exited with code 0 (0x0).

Kind regards

Johannes
Comments: ** Comment from web user: JohRest **

Hi,

what do you think about this alternative implementation?

Just as a discussion Point....

Regards

Johannes

New Post: OperationTimeout and ConnectionInfo.Timeout don't terminate the process

$
0
0
thanks reawakening the thread and for the updates.
i was testing the last commit to see if OperationTimeout works as i predicted.

i set: sftp.OperationTimeout = TimeSpan.FromSeconds(1);
and used asynchronous upload, usinf this code:
                        sftp.ConnectionInfo.Timeout = TimeSpan.FromSeconds(1);
                        sftp.OperationTimeout = TimeSpan.FromSeconds(1);


                        sftp.Connect();



                        using (stream = new MemoryStream(byteArray))
                        {
                            IAsyncResult sftpASynch = sftp.BeginUploadFile(stream, fullPath, null, null);

                            if (!sftpASynch.AsyncWaitHandle.WaitOne(100))
                            {

                                sftp.EndUploadFile(sftpASynch);

                                Console.WriteLine("send file by sftp process was terminated after: " + sftpOperationTimeout + " seconds");

                            }
                        }
                        Console.WriteLine("Send by SFTP finished. Path:" + fullPath);
after some seconds (although OperationTimeout was set to 1 second) the file was uploaded to the server and was not terminated as supposed to.

New Post: SCP copy to a specific folder

$
0
0
Hi
I'm using your latest commit 22965 and i still get af file not found error. The source file and destination directory exists.

I've tried:
            client.Connect();

            Stream filestream = new FileStream("filename.zip", FileMode.Open, FileAccess.Read); 
            client.Upload(filestream, "/dir/sdcard/"); 
            filestream.Close();

            client.Disconnect();
When i excecute the upload command i get an exception: "scp: : No such file or directory" in line 344 in ScpClient.cs

Renci.SshNet.Common.ScpException was unhandled by user code
Message=scp: : No such file or directory
Source=Renci.SshNet
StackTrace:
   at Renci.SshNet.ScpClient.CheckReturnCode(Stream input)
   at Renci.SshNet.ScpClient.Upload(Stream source, String path)
   at LinkTest.LinkTestFixture.TestUploadLatestFirmwareToLink() in 
C:\Users\k\Desktop\Link\Pc\trunk\LinkTest\LinkTest\LinkTestFixture.cs:line 184 InnerException:

Do you any suggestions to how to solve this problem?
Thanks
Viewing all 2955 articles
Browse latest View live


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