From the course: Linux Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

SSH: Transferring files with scp and sftp

SSH: Transferring files with scp and sftp - Linux Tutorial

From the course: Linux Tips

SSH: Transferring files with scp and sftp

- [Instructor] As we work at the command line, we might want to transfer files from our local machine to the remote machine or vice versa. The SSH protocol gives us two methods of doing this: SCP and SFTP. SCP is short for Secure Copy and it's a command that you run on a local machine. It uses SSH credentials to open an encrypted connection of the remote machine and copy a file between the two. The syntax for it is to use the command scp and a source and a destination. It works pretty much like the regular CP or copy command except that the remote end of the connection is specified a little bit differently than the local one. Let's say we wanted to copy a notes file from a remote server to our local system. The command would look like this: scp remoteuser@hostname:notes and then a space and then the destination, in this case, the documents folder. The remote portion of the command has a username@thehostname and will be prompted to enter that user's password when we run the command…

Contents