Using sftp to Copy Many Files Between Machines
sftp is a mix between ftp and scp. Connecting to the server uses the same syntax as scp—you can just specify an IP address to connect using your current username, or you can specify a username using username@ipaddress. You can optionally add a colon and a directory, as with scp. After you are connected, the commands are the same as ftp: cd, put, mput, get, quit, and so on.
In one of the scp examples, we copied a remote file locally. You can do the same thing with sftp with the following conversation:
matthew@seymour:~$ sftp 192.168.1.102Connecting to 192.168.1.102...matthew@192.168.1.102's password:sftp> get remote.txtFetching /home/matthew/remote.txt to remote.txt/home/matthew/remote.txt 100% 23 0.0KB/s 00:00 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access