If you're a linux[1] user who deploys multiple devices, I implore you: learn the command `scp`. It will change your life
It lets you copy files over an ssh pipe; if there's an ssh server on that host, you can essentially directly address a known file on that filesystem and say pwease gimme. And it's roughly the same syntax as `cp`, just with a `[user]@[host]:` before *either source or destination*[2].
And the real kicker is that neither source nor destination need be local:
I copied a file from my web server to an icecast source client host by passing it through my phone.
Unreasonably handy tool to have on your toolbelt.
Footnotes under the cut.
[1] Okay, fine, you got me! It's not solely a linux util. SCP is part of the openssh suite, which means that it's available on virtually every OS under the sun... Including being included by default on Windows 10 1709 and later versions of Windows. It's already on your mac, your BSD system, and almost certainly your phone, too. SSH servers and *nix go together like picnics and baskets, though, so I wouldn't exactly pull the *average* windows user aside to recc' `scp`.
[2] What's most interesting to me is that the `[user]@[host]` is used for the SSH client to know where it's authenticating and how, but the actual filesystem location's format is not processed by the SSH client; it's the *server's* format, not the client, that matters for parsing the file location. In some cases this can lead to a mismatch on filenames that you're receiving vs requesting, but the -T flag disables that checking, and then use `[email protected]:D:\\Documents\\testdata.bin` (drive letter indicated and backslashes escaped) to refer to it
ok btw just because i see people getting this wrong often.
If you install OpenSSH, the "scp" command NO LONGER uses the original Secure Copy Protocol. The original Secure Copy Protocol is outdated and insecure, and if you have a system that has it installed somehow, please get rid of it and/or don't use it.
According to Wikipedia, as of OpenSSH v9, the "scp" command uses SFTP, which is good and works and is secure.
The confusion is reasonable given that it's hard to tell someone that the "scp" command. doesn't use the scp protocol. And instead uses the protocol of another command instead. But yes, using "scp" or "sftp" both are okay because "scp" uses SFTP under the hood anyway.
sorry for the rant :3 I just saw something on reddit and had to correct x3