Hello, Do you have a suggestion, how can i use rebex to achieve this. We have a one server (Say x ) through which we can access other servers (a,b,c). How can I run a command on server a , and ftp its contents to my machine using rebex dll

regards

asked 25 Jun '10, 16:48

babs's gravatar image

babs
16
accept rate: 0%


You can use Rebex FTP or Rebex Telnet together with Rebex.Net.Ssh.dll (part of Rebex SFTP or Rebex Secure Shell) to achieve this. To connect to an FTP or telnet server through an SSH server, use this code:

using Rebex.Net;
...

// connect to SSH server X
SshSession session = new SshSession();
session.Connect("X");
session.Authenticate(userNameForX, passwordForX);


// connect to FTP server A through SSH server X
Ftp ftp = new Ftp();
ftp.SetSocketFactory(session.ToSocketFactory()); // sets up tunneling through SSH
ftp.Connect("A");
ftp.Login(userNameForA, userNameForB);
// get the file using FTP here
...

// connect to telnet server B through SSH server X
Telnet telnet = new Telnet("B");
telnet.SetSocketFactory(session.ToSocketFactory()); // sets up tunneling through SSH
// start a Shell 
Shell shell = client.StartShell();
...

(If you prefer VB.NET, please let us know!)

Other Rebex components (SFTP, IMAP, POP3, SMTP) can also connect over an SSH session in the same way.

link

answered 28 Jun '10, 09:24

Lukas%20Pokorny's gravatar image

Lukas Pokorny ♦♦
2.2k18
accept rate: 32%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×136
×39
×4

Asked: 25 Jun '10, 16:48

Seen: 361 times

Last updated: 28 Jun '10, 09:24