2

I have a desktop application that's connecting to a Linux VPS via SSH that contains files that need to be uploaded to another server. Is this something I can do with SSH.NET or any other library? Or should I maybe go with the inefficient route of first downloading the files locally then initiating an SFTP connection to the server I need to upload to? Or maybe there's something completely different I should be doing - I'm open to suggestions.

Any direction would be appreciated.

4
  • 1
    How can you connect to the other server? Over SSH as well? Or over FTP? Could you try just running an scp command on your VPS? Commented May 23, 2018 at 21:48
  • 1
    I've used SSH.NET for this at my previous job to push files to another server. I would suggest this library if you need to create a quick little app. Commented May 23, 2018 at 21:56
  • To connect to the other server that I'm uploading to I need to connect via sftp. The only other drawback for me at this point is my lack of Linux command line experience. If I can execute a command via ssh to do this then that would probably work for me too. Commented May 23, 2018 at 22:22
  • @JohnDoe SSH.NET and Renci.SshNet is the same library (first is library name, latter is library namespace). Commented May 24, 2018 at 6:17

2 Answers 2

1

There's nothing in SSH/SFTP that would help you implementing a file transfer between two remote servers. So SSH.NET library won't help you much with that either.

All it can do for you, is to execute the same shell commands (sftp) on server A that you use manually to upload the files to B.

Sign up to request clarification or add additional context in comments.

1 Comment

I had a feeling that might be the case. I'm trying to separate some internal processes (including this task) from a public facing web application that would not necessarily need to be part of the web application. I think I'll opt to download the files from server A, and ftp upload to server B after... seems a little clunky, but it'll work. Might experiment with the shell commands while I'm at it too. Thanks!
0

I opted to do the following:

  1. SSH into server through the desktop application
  2. Send an scp command to run a .net core console app on the server
  3. App on server performs ftp upload along with any other tasks I wanted to perform in the process.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.