DEV Community

Discussion on: Securely Transfer Files with SFTP

Collapse
 
bgadrian profile image
Adrian B.G. • Edited

Nice!

If you use Linux/Mac (or Bash on windows) I suggest trying SCP, it has a very simple syntax and if you are already using SSH you already know how to use it (it has many common parameters).

The advantage is that you do not need an extra server/service like FTP.

#Copying file to host:
scp SourceFile user@host:directory/TargetFile
#Copying file from host:
scp user@host:directory/SourceFile TargetFile
scp -r user@host:directory/SourceFolder TargetFolder

Enter fullscreen mode Exit fullscreen mode

For file synchronization see rsync, used for more complex scenarios (ex copy only the missing files, or the newer ones).