DEV Community

Cover image for File transfer through SSH is easy!

File transfer through SSH is easy!

Mateus Abelli on August 20, 2023

For newcomers, SSH itself might look hard at first and file transferring even more complicated. How to connect to a remote machine to send or copy ...
Collapse
 
moopet profile image
Ben Sinclair

Yeah, I'll use scp for a quick glob or directory, or if rsync isn't installed, but rsync is much better in most cases.

Collapse
 
mateusabelli profile image
Mateus Abelli

Hello Ben, I havent studied rsync in depth but it looks like a great option to have the files synced between remote and local host. Thanks for the comment :)

Collapse
 
moopet profile image
Ben Sinclair

Neither of them have to be remote or local, by the way. You can scp or rsync on your local drive from one directory to another just as easily. With rsync though, it gives you the super powers to do things like only copy files that have changed, or to delete files that aren't in the source directory!

Thread Thread
 
mateusabelli profile image
Mateus Abelli

That's awesome, I'm definitely going to check out rsync, those features are super useful! thank you :)

Thread Thread
 
koas profile image
Koas

Also, rsync is the base for the almighty rsnapshot, a great tool to make data backups across servers or between your hard drive and an external drive.

Collapse
 
cwprogram profile image
Chris White

Hi Mateus,

I really like how your article was presented. If you're looking for more article ideas, I think something on basic ~/.ssh/config usage would be helpful (and maybe ssh-agent). It would really tie well with the content you have here. Keep up the good work!

Collapse
 
mateusabelli profile image
Mateus Abelli

Hey Chris, thank you, that is awesome! I'll take a look at your suggestions with great appreciation :)

Collapse
 
inovak profile image
Ivan Novak

Great write up Mateus!

I really like the use of emoji pointers to annotate the code and call out specific pieces of the commands.

Collapse
 
mateusabelli profile image
Mateus Abelli

Thank you, I'm still looking at yours to get inspiration but I think that with time I'm going to get better at it. It's awesome that you read it, thanks again 👍

Collapse
 
inovak profile image
Ivan Novak

I appreciate that Mateus! I'm thrilled that you're working at it.

Keep up the great work man!

Collapse
 
shubhamsomu profile image
Shubham Upadhay

yeah.. same in my case i use rsync more often to grab files from staging to local server.. and sftp when sending files to third party's server

Collapse
 
respect17 profile image
Kudzai Murimi

Well-documented!

Collapse
 
mateusabelli profile image
Mateus Abelli

Thank you Kudzai :)

Collapse
 
dengzhuhub profile image
dengzhu-hub

what is this

Collapse
 
mateusabelli profile image
Mateus Abelli

Hello there, those are ways of transfering files through a ssh connection