Home » Questions » Computers [ Ask a new question ]

How to transfer files when given two SSH accounts?

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:

Asked by: Guest | Views: 249
Total answers/comments: 5
Guest [Entry]

"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.)"
Guest [Entry]

"try this on a terminal window
ssh username@domain.com
it will ask for your password later
if you don't know what a terminal is, search the spotlight for ""terminal"""
Guest [Entry]

"Open Terminal (in your Applications/Utilities folder), and type the commands as given. OS X comes with an SSH program.

There are GUI ssh programs, but the command line stuff seems like it's going to be more appropriate for this, since they're giving you the command lines already."
Guest [Entry]

"Only if you need to access the files quite often, and only recommended after the procedures using Cyberduck or Transmit have been successful (to ensure your credentials and all are fine):

Mount the domain2.com resources locally using SSHFS with FUSE for OS X (formerly packaged in MacFUSE, but that does not support 10.6 and up).

ssh -L -N 45454:domain2.com:22 user1@domain1.com
sshfs user2@localhost:/ ~/project -oport=45454,follow_symlinks,volname=Project

The second line can also be done through a GUI, using Macfusion, but then be sure to read the SSHFS notes about that."
Guest [Entry]

"What you are tying to do is quick tricky for a newcomer to SSH. Several of the answers here don't even understand what you are asking for!

I've found this guide really good to explain the process of connecting via another host. The diagrams really help."