

$ scp file.txt To copy a directory instead of a file to the remote system, you will need to use the -r option in your scp command. If we had wanted our original file to adopt a new file name on the remote system, we can specify that in our command.After supplying the password or authenticating with RSA keys, our file file.txt will be copied from the local system into remote directory /home/linuxconfig.

$ scp file.txt this example, we are authenticating with the username linuxconfig on server 10.1.1.20.

SSH COPY FROM REMOTE TO LOCAL HOW TO
In this guide, you’ll learn how to use the scp command in Linux through examples. The scp command is more ideal for quick and simple transfers of one or a few files. For complex file transfers or complete backups, it’s recommended you use something more like the rsync command. However, it’s not the only command in Linux that is capable of this. This in turn provides end-to-end encryption for all data transfers.Īs you can imagine, being able to copy and paste files to or from remote systems is extremely useful. The actual data transfer and user authentication is done via Secure Shell (SSH). This protocol is used for file transfers between connected hosts on the local network or over the Internet. The SCP command is based on the BSD RCP protocol.
