From the course: Linux System Engineer: Networking and SSH

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Execute commands remotely using SSH

Execute commands remotely using SSH

From the course: Linux System Engineer: Networking and SSH

Start my 1-month free trial

Execute commands remotely using SSH

- [Narrator] There are several different ways of transferring files from one to host to another using an encrypted tunnel, the easiest being scp or secure copy. scp acts like the local cp command, but the arguments a bit more complex as you'll see. The syntax for scp is, scp, space, options, space, source file, space, destination file. At first glance the syntax looks the same as the cp command, however, the source and destination files may include the host name or IP address. For instance to copy the local/etcs/hosts file to a remote server you might type in, scp, space, /etc/hosts, space, the IP address, :/tmp. The source file is the local path and the destination file is an IP address and remote path separated by a colon. We can also copy a remote file to a local location by reversing the arguments. Now the source is the remote host and the destination is a local path. This copies the remote/etc/hosts file to the local/tmp directory. By default scp uses the standard SSH port number…

Contents