Search code examples
linuxfilescpnas

Linux file copy from mounted NAS to remote server using scp


file1 is on the NAS mounted ServerA.

ServerA /mntnas/file1

ServerB /dest

If doing: user@ServerA> scp /mntnas/file1 user@ServerB:/dest

will the file1 transfer go through ServerA or directly from NAS to ServerB?

Thanks.


Solution

  • You are logged in as user on ServerA, therefore scp will start an ssh session from ServerA to ServerB to copy the file.

    Because scp doesnt know anything about networked storage it will let the filesystem handle giving it the bytes that the file is made up of, so your file will be transferred from

                NAS -> ServerA -(ssh tunnel)-> ServerB