In this video, I'll tell you about how to copy files securely using SSH.
That will be SCP.
SCP is a part of the SSH bundle, and it is used to securely copy files over the network
using the SSHD process.
So it only works if on the target server you do have SSH.
You would use a command like SCP file 1, file 2, student at remote server slash home slash
student, which will copy file 1 as well as file 2 to the remote server.
Or SCP minus R, root at remote server colon tmp files to dot, which will do a recursive
copy as user root on the remote server of the entire contents of the directory tmp files.
Notice that for this to work, you do need to allow root user access.
Related to this is also SFTP.
And SFTP is a little bit less common.
It offers an FTP client interface to securely transfer files using SSH.
Now the thing is that not many people are using FTP anymore, but if this is something
for you, in the SFTP interface, you can use put to upload a file or get to download the file
to the current directory.
And once you're done, you're using exit to close the SFTP session.
Let me show you how to securely copy over a file.
So do we have some nice files?
We do.
File 3.
And I'm going to use SFTP file 3 to student at 192.168.29.143 colon slash tmp slash.
So it's asking for the remote host identity.
And let me use yes to verify and enter the password.
And there we can see that it has been copied over.
So now the file has been copied over to the remote server.
That's how SFTP can conveniently be used to transfer files.