Friday, 5 July 2019

mac - How to transfer files when given two SSH accounts?


I need to set up file transfer for which I've received the following access info. But I'm not sure how to connect, having hardly used SSH before. The instructions I got are:



First: ssh user1@domain1.com, password: password1
then: ssh user2@domain2.com, password: password2



I'm on a Mac. What client and settings should I use?



Answer



Ok, apparently you said the first server is just a relay, so let's use a SSH Tunnel. Here is what you can do in Terminal:


ssh -N -t -x -L 45454:domain2.com:22 user1@domain1.net

After entering the password you will not see anything happen. (Alternatively: remove the -N to actually see the command prompt of domain1.net.) And then in Transmit, you ask to connect to:



User: user2


Domain (server): localhost


Port: 45454


Protocol: SFTP (SSH)



This should normally allow you to use Transmit to connect to the second server, through the relay of the first one.


When done, stop Transmit, and then in Terminal hit Ctrl-C to stop ssh as well. (Or, if you started ssh without the -N parameter, then type exit instead of using Ctrl-C.)


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...