3

Is it possible to directly transfer files between two remote servers when they don't use the same protocol? I have a lot of files on serverA (which, at least for now, must be accessed using SFTP) and want to copy them to serverB (which must be accessed using FTP). Unfortunately, I can't do anything on the servers themselves as I am an external client for both.

1 Answers1

3

If I understand what you're asking correctly, I think you can do it with

sudo apt-get install sshfs

followed by

mkdir serverAFiles
sshfs serverA:/path/to/the/directory serverAfiles

Now you will see the files on serverA in the 'serverAfiles' directory just as if they were on the local machine, and can ftp them onto serverB just as if they were local.

When you're done,

fusermount -u serverAfiles

will break the ssh connection and you'll no longer see the remote files as being local.

muru
  • 197,895
  • 55
  • 485
  • 740
  • Thanks. I'll give it a try when I get the chance. I hadn't even thought of mounting one of the servers. – Andrew Shum Nov 01 '17 at 16:54
  • It partly works. I can access the mounted system but only if I am doing it as root. Changing the permissions on the folder it is mounted to does nothing. Any ideas? – Andrew Shum Nov 01 '17 at 20:17
  • Never mind, I found the answer here. – Andrew Shum Nov 01 '17 at 20:54
  • Follow-up Question: According to the documentation, you are supposed to be able to use ssh options with sshfs. How do you do this? I have tried something like -o User=joe but then fuse gives me an error saying that User is not a recognized option. – Andrew Shum Nov 10 '17 at 19:07