Moving Files In Linux - page 8
The Low Security Family
sftp is an interactive tool that works over an ssh connection, mirroring the ftp program's functionality´┐Żand is in fact a nice front end to scp. You won't be using this client for anonymous downloads, but if you need to move data or other confidential information between machines, this is an excellent tool to choose. Once you've mastered the scp command you'll find sftp simple to use, or vice versa. They share many of the same flags and mostly the same syntax.
Let's say that I want to FTP copies of some vital trade secrets from my office machine (user d.leblanc at work1.example.com) to my home machine (user dee at egg.example2.com)--okay, so let's not discuss why I'd want to be crazy enough to risk this in the first place--without someone being able to sniff out the data being passed along or any passwords along the way. Once I have ssh set up for a proper connection on both machines, I can open the connection using:
After being challenged for the password for user "dee," which is transmitted in a tunnel through the secure shell, I'm in and have the sftp prompt. Now I can use any of the commands in the sftp man page's INTERACTIVE COMMANDS section. Such a session might look like the following:
sftp> mkdir StealMe sftp> cd StealMe sftp> put formulas/secret/* Uploading formulas/secret/worldpeace to /home/dee/StealMe/worldpeace Uploading formulas/secret/worldpeace to /home/dee/StealMe/worldpeace Uploading formulas/secret/baldcure to /home/dee/StealMe/baldcure Uploading formulas/secret/slimmer to /home/dee/StealMe/slimmer Uploading formulas/secret/senseofhumor to /home/dee/StealMe/senseofhumor sftp>
So think of sftp as the more advanced, interactive cousin of scp.
- 1Linux Top 3: Alpine Linux 3.4, deepin 15.2 and Linux Lite 3.0
- 2Linux 4.7 Set to Boost Live Patching, Security and Power Management
- 3Linux 4.6 Charred Weasel adds USB 3.1 Support
- 4Linux Top 3: OpenIndiana 2016.04, Ubuntu 16.04 and Debian's New Leader
- 5Linux Top 3: KaOS 2016.04, TurnKey 14.1 and pfSense 2.3