Questions tagged [ssh.net]
SSH.NET is an open-source .NET port of the Java Sharp.SSH library and is available under the BSD and MIT license.
355
questions
0
votes
0
answers
31
views
SSH.NET retrieving output from ShellStream, minicom does not return anything
I was able to successfully connect using this example SSH.NET retrieving output from ShellStream and run all commands and process the results. I only have problems after I send the command minicom -D /...
0
votes
0
answers
23
views
Renci SSH.NET doesn't return complete result
I need a program to send switches some commands and analyse their returned echo. So I wrote some code to send and get echo string. However, I found out some strange phenomenon.
Sometimes, I find the ...
1
vote
0
answers
29
views
Implement SFTP server in .NET
I need to implement SFTP Server within .net core project.
I realize the most commonly used library for SSH is SSH.net but I didn`t found anything about server implementation using the library, Only ...
0
votes
1
answer
46
views
Why is my asynchronous code with .NET Core 6 and SSH.NET working synchronously?
I need expand this code and will be call this code from Quartz thread and than notify frontend by SignalR, because operation will be going by hours.
But as first step I call this code directly from ...
-1
votes
1
answer
304
views
Can't connect to OpenSSH SFTP when using SSH.NET in a WCF Service
The organization has a integration service layer built on .NET 4.5.2. It has several WCF services running. One service uses SFTP to connect to SFTP server in the same machine to read and move some ...
0
votes
0
answers
33
views
Error: "The type or namespace name 'SshClient' could not be found" .NET 6
hoping I can get a little guidance as to why it seems like I'm unable to use the SSH.NET package in my .NET Core project. I have a simple web API that I'd like to wire up to an existing MySQL database,...
1
vote
1
answer
88
views
Check is file transfer with SSH.NET was successful or not
I am working on SSH.NET file Upload function in .NET CORE 6 application. It is all working fine. To find status as if the file is loaded successfully, I am calling event from Upload method however I ...
0
votes
1
answer
50
views
Use LINQ to filter SftpFile based on separate given extension array
I am working on .NET CORE 6 solution. I have list of sftpFile SSH.NET along with each extension and another list of extensions i.e. .csv. I want to LINQ to filter files from list 1 based on list 2. i....
-1
votes
2
answers
58
views
What is best way to implement fix pre-define values of List<string>?
I am working on .NET CORE 6 Renci.SshNet library. When I read files using SftpClient.ListDirectory I also read . & .. as files. I want to create list of const outside service class that just deal ...
0
votes
0
answers
85
views
Send password value after execute command (SSH.NET)
I have one problem with SSH.NET. I'm trying to create email mailboxes programmatically (using a command available on the hosting I purchased), but after executing the command, you have to enter the ...
1
vote
0
answers
192
views
Create SSH ED25519 key with BouncyCastle for Rency SSH.NET in C#
I have to generate the public and the private keys with BouncyCastle in ED25519 version (NOT RSA) and I not able to generate it correct.
I have try with:
var gen = new Ed25519KeyPairGenerator();
var ...
0
votes
0
answers
89
views
ssh.net SshOperationTimeout on second connection
I'm connecting to the ssh on a second form. When I first execute the connect() command, everything works fine. If I close the form and try to reconnect I get SshOperationTimeout after the method ...
0
votes
0
answers
20
views
SSH.NET responds differently to OpenSSH when calling a CLI application [duplicate]
I am accessing an embedded linux SBC to execute and interact with a CLI application. This works with OpenSSH (on Windows10) to launch the application then the application accepts text commands and ...
2
votes
1
answer
442
views
Find most recent SFTP file with a particular filename using SSH.NET
I have a folder on an SFTP server that has a bunch of files. There are 6 different files, and they are created every 60min. Each with a date and time stamp, and they are held for 3 days.
...
0
votes
1
answer
60
views
What is the differece between Shell and ShellStream in SSH.NET?
And when should I use Shell vs ShellStream?
My intent is to send keys one by one (if possible, sending Ctrl-like keys separate from the alphanumeric keys), not the whole commands, and receive the ...
1
vote
0
answers
51
views
SSH.NET autentication fails with "openssh key type: ssh-rsa is not supported" [duplicate]
I'm trying to send files using SFTP with public/private keys. I've found examples in C# but very few in VB. Trying to convert, I've got this far, but get an error at the first line despite being ...
0
votes
0
answers
105
views
Renci SSH.NET used in Windows service
I have written a Visual Basic solution in Visual Studio 2019 that makes use of Renci SSH.NET to open a SSH connection to an AWS server. It is installed on a customer machine running Windows Server ...
1
vote
1
answer
373
views
NOT getting the full output from ssh.net SshCommand [duplicate]
I am using the Renci.SshNet nuget pacget (version 2020.0.1) in visual studio 2019.
What I am trying to do is to execute a command over SSH and return the whole result text.
this method works. but I ...
0
votes
0
answers
22
views
SSH.NET howto use an interactive sub shell for my commands [duplicate]
With SSH.NET it's rather easy to perform simple commands at the shell that the remote SSH server runs for the client.
For instance, I can just make a call like this (after the connection is esablished)...
1
vote
1
answer
190
views
Attach file from SFTP server using SSH.NET to MailMessage
Is there a way to get this working?
We are getting a file from an SFTP server and we need to email it to someone as part of a CRON automation job.
Here is what I have, but I cannot send the file as an ...
0
votes
1
answer
234
views
Executing command using SSH.NET produces no output
I am trying to make a program that connects to an SSH server and then logs me in. I have successfully created tracert or ping commands, but SSH connection doesn't work for me at all. I am using SSH....
0
votes
0
answers
25
views
Efficient way to download large number of files from sftp directory with ssh.net.sftp? [duplicate]
I have a scalability concern with using ListDirectory from ssh.net on a potentially very large list of files (hundreds or thousands of 3-5kb files). When getting a file, I need to open it, download it,...
1
vote
0
answers
300
views
Azure App Service SFTP outbound error An attempt was made to access a socket in a way forbidden by its access permissions
I have an Azure App that uploads files to another server through SFTP (port 22) using SSH.NET. I confirmed that everything works fine on my local machine, but after deploying to Azure App Service and ...
0
votes
0
answers
153
views
Renci SSH.Net - ErrorOccured event raising different on Windows and Linux
I am using Renci SSH.Net library for establishing a long running SSH connection and I have noticed a difference in behaviour when running it on Windows and Linux.
I am using sshClient.ErrorOccurred += ...
0
votes
0
answers
178
views
Renci SSH.Net - how to properly use RemoveForwardedPort() on Linux and .Net Core
I have a problem with Renci SSH.NET implementation on Raspbian 10.
My scenario is long running SSH tunneling connection with a number of ForwardedPortRemote's.
In required places I do:
For SshClient:
...
0
votes
1
answer
2k
views
Cannot connect remote SFTP using SSH.NET package in .Net Core
I want to connect to SFTP to download files from there. I can able to login into SFTP by using the credential via website and Command Prompt (using ftp command) as well. Now, I want to connect it from ...
-1
votes
1
answer
216
views
Connectig to sFTP Server using SSH public/private key. Error {Invalid private key file.} Using SSH.NET
Firstly I generated the keys using
var keygen = new SshKeyGenerator.SshKeyGenerator(2048);
var privateKey = keygen.ToPrivateKey();
var publicSshKey = keygen.ToRfcPublicKey();
The private key ...
1
vote
1
answer
775
views
Execute command with SSH.NET without blocking and keep it running after closing the connection
I'm using the following code:
using (var client = new SshClient(host, user, pass))
{
client.Connect();
var terminal = client.RunCommand("/home/my-script.sh");
}
The client....
2
votes
1
answer
1k
views
Unable to mock SSH.Net's SFTPClient object for Microsofts Unit test case framework
I have used SSH.Net's SftpClient object to perform upload and dowload operations on the server.
I am trying to write unit test cases for the class that uses this SftpClient object.
The class itself is ...
0
votes
1
answer
862
views
Stream interface to a file on SFTP server in C# SSH.NET
I am connecting to an SFTP server using SSH.NET and trying to read an image into a stream for displaying it in my web page.
SftpClient client = connectToServer(IP,user,pwd);
string remotePath = ...
1
vote
1
answer
293
views
Download file to browser from SFTP server in ASP.NET using SSH.NET
With SSH.NET, I am trying to trigger a file to be downloaded by the browser instead of directly writing it to the local file storage.
using(var saveFile = File.OpenWrite(@"Downloads")) {
...
0
votes
1
answer
129
views
forwarding x11 by SSH.NET c# library
I am using the ssh.net as an extension in TestStand, but I need somehow display the x11 forwarding. Is it possible somehow?
I am using xming server on my win. machine.
Thank you
0
votes
1
answer
587
views
"Invalid private key file" when authenticating to SFTP with SSH.NET using a key in a string
I have a program where I want to connect to an SFTP host and push/pull files. The host requires a private key to connect. Using these posts for guidance:
"Renci.SshNet.Common.SshException: ...
-1
votes
1
answer
308
views
SSH.NET [ObjectDisposedException: Cannot access a disposed object. Object name: 'Renci.SshNet.SshClient'.]
I am attempting to create an SSH client to connect to a custom SSH server. When running the program I receive :
Exception Details: System.ObjectDisposedException: Cannot access a disposed object.
...
0
votes
1
answer
53
views
Using Public/Private Keys that were created with Putty
I am following one the examples from a search of ssh.net examples.
This example uses public/private keys.
I have a general understanding, however the example has a .pem extension on the private key ...
0
votes
1
answer
255
views
Copying files to remote and creating directories and recursive copying
I am using SSH.NET to copy files using an ScpClient. This works fine. However, if I want to copy files to a destination that doesn't exist yet, there doesn't seem to be a way create the destination ...
1
vote
1
answer
130
views
C# SSH.NET half-duplex raw binary connection
I'm trying to get half-duplex ssh connection in C#/.NET 5 with SSH.NET for sending protobuf-formatted packets. (Although full-duplex would be nice, I can emulate that using two streams)
So far I'm ...
0
votes
0
answers
351
views
.net 5.0 blazor client app ssh connection
Trying to make a ssh connection from within a .net 5.0 blazor client app.
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net5.0&...
0
votes
2
answers
299
views
SSH.NET uncatchable exception
I'm trying to upload a file using SSH.NET using C# in a .NET Framework 4.5.2 project.
As soon as the ConnectionInfo constructor is invoked the application exits without any Exception not error message....
0
votes
1
answer
255
views
SSH.NET Real-Time Logging High CPU
Let me preface this question by saying I'm absolutely not a pro C# programmer and have pretty much brute forced my way through most of my small programs so far.
I'm working on a small WinForms ...
0
votes
2
answers
286
views
How to check file download SSH.NET C#
I'm using SSH.NET library in a desktop application. How can I arrange to check the upload to the server if the connection is broken. I conducted a small experiment with the folder synchronization ...
0
votes
0
answers
63
views
Why would BizTalk 2016 kill custom pipeline component threads?
I have a BizTalk Custom Pipeline Component that writes an SFTP file (using SSH.net), triggered by an SFTP (WinSCP) receive location.
The code within the Retry occasionally (around half the time) does ...
1
vote
1
answer
463
views
SFTP cannot be deleted after having been read using SSH.NET SftpClient.OpenRead
I am using Renci.SshNet to connect to SFTP and loop through files which is present in a folder one by one, and delete once we read a file. Then we continue with next file. But I am observing a issue ...
0
votes
0
answers
239
views
SSH.Net: Executing reboot command times out after changing IP Address
I'm using SSH.Net to configure some device's IP Addresses. The device requires a reboot to save the changed settings.
When I send the reboot command, the device reboots as expected, but the execute ...
0
votes
1
answer
133
views
Providing input to prompts that automatically display upon login to a device in SSH.NET
I have a device I'm trying to connect to via SSH, in order to automate its configuration. Normally when you first connect to the device, it asks you to set up a local administration account. We don't ...
2
votes
1
answer
686
views
Connecting with SSH.NET to OpenSSH 7.4p1 fails with "The server response contains a null character at position" but works in WinSCP
I am trying to connect to an SFTP server using SSH.NET (2020.0.0).
My code looks as simple as this:
try
{
var x = new ConnectionInfo(FtpIpAddress, 22, FtpUser,
new ...
4
votes
1
answer
661
views
"The server response contains a null character" when connecting to FTP site on port 990 using SSH.NET
I'm trying to use Renci SSH.NET to connect to an FTP site and download files from my C# app. I can successfully connect to the host with FileZilla and WinSCP (on Windows 10 Pro 64), and through an ...
12
votes
2
answers
9k
views
Using "OPENSSH" private key file in string with SSH.NET in C# fails with "invalid private key file"
I'm not experienced with SFTP or OpenSSH. I am trying to connect to a client's SFTP to upload a file.
I am using the SSH.NET library – https://github.com/sshnet/SSH.NET
Within my C# code I have the ...
0
votes
1
answer
437
views
C# Error using ssh.net to retrieve data from SSH server [duplicate]
I keep getting the following error when I try to connect to an SSH server (in this case the SSH server is the iDRAC on a Dell server):
Renci.SshNet.Common.SshAuthenticationException
HResult=...
0
votes
0
answers
723
views
Xamarin Pair to Mac error installing Broker - ScpClient lost connection
I'm using Visual Studio 2019 on Windows 10 and I'm setting up a new Mac build host for others to use to build our Xamarin iOS project. I've been using my own work-issued Mac build host for years to ...