5 ms·
The instructions in this article should work, but they're more complicated than necessary maybe. If you don't have scp, you can usually just do something like t
by nrclark 6y ago
The instructions in this article should work, but they're more complicated than necessary maybe. If you don't have scp, you can usually just do something like this:
ssh user@host cat remote_file > local_file
to copy the contents of "remote_file" on the server to "local_file" on your local machine.
- Fnoord 6y ago> If you don't have scp [...] scp is deprecated [1]; use sftp instead. At the very least, sftp should be your preference over scp. [1] https://unix.stackexchange.com/questions/571293/is-scp-unsafe-should-it-be-replaced-with-sftp https://unix.stackexchange.com/questions/571293/is-scp-unsaf...
- nrclark 6y agoScp works fine, I use it all the time. It's less complicated than sftp, and works basically just like the regular 'cp' command. It also doesn't require an sftp server to be present on the remote machine. I'm not 100% sure I buy those "it's less secure" arguments in that Stack-exchange post, but even if true - lots of people use SSH to move stuff around inside an intranet, where both ends of the connection are trusted. In that kind of context, scp works great.
- tialaramex 6y agoWhich parts of the facts listed do you not "buy" ? The fact that a remote server gets to silently respond to the request "Hey, I'd like funny-cat-noises.mp3" by writing two files, funny-cat-noises.mp3 and also .security/overrides.conf ? Maybe your understanding of the protocol was that you allow a remote server to write whatever files it wants to your disk. That seems like a pretty crazy thing to want, but OK. Most people assume it does what it seems like it does. You name one or more files on one machine, and they're copied to the other machine. SFTP can deliver without nasty surprises, but SCP can't really do so, although the OpenSSH team have worked pretty hard to make the worst surprises less likely to bite you.
- nrclark 6y agoThat sounds like it's an issue if one is copying from an untrusted server, for sure. Maybe not an issue if you trust the machine you're copying to/from.
- Fnoord 6y ago> Maybe not an issue if you trust the machine you're copying to/from. Maybe you shouldn't. After all, the remote machine doesn't have root on your machine. Even if you are root on the remote machine, how can you know the server isn't compromised? You can't.
- fulafel 6y agoYour link doesn't say it's deprecated... the sftp command has lousy ux, it's unlikely people will switch to it en masse.
- Fnoord 6y ago> The scp protocol is outdated, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead. [1] > From The Jargon File (version 4.4.7, 29 Dec 2003) [jargon]: > deprecated adj. > Said of a program or feature that is considered obsolescent and in the process of being phased out, usually in favor of a specified replacement. [..] [1] https://www.openssh.com/txt/release-8.0 https://www.openssh.com/txt/release-8.0
- fulafel 6y agoBut your cited definition agrees with me? It's not being phased out, hence not being deprecated.
- V6HBGNQHU 6y ago> The scp protocol is outdated, inflexible and not readily fixed. We recommend the use of more modern protocols like sftp and rsync for file transfer instead.
- fulafel 6y agoI'm not sure what the misunderstanding is here.. The above text says there are better protocols and recommends their use over scp, but doesn't say scp is being phased out or discontinued in the future. On *ix things stay around for pretty long. You still have ed and ftp on Ubuntu 20.04!
- xorcist 6y agorsync has pretty much identical ux to scp and is actively maintained.
- vlovich123 6y agoIf you can do that can’t you just use rsync?
- susam 6y agoI have a convoluted method in my blog post due to the constraints I was working with. The SSH connection to the host goes via an SSH gateway that forbids the execution of remote commands without a login shell. I have laid out this constraint in the first paragraph of my blog post. Without this constraint, yes, I agree what you mention would be the obvious straightforward solution.
- ed25519FUUU 6y agoReally glad someone mentioned this. Works fine with binary data (doesn't need to be base64 encoded), and is much simpler.