

Let’s execute the hostname command on the remote host: $ ssh -l root 192.168.19.130 hostname In such cases, we can execute those commands without creating a long-term session. Sometimes, we just need to execute one or two commands on the remote host.
Ssh copy long text file how to#
In the previous section, we saw how to establish a connection with a remote host, which is suitable only when we are going to use the remote host for a longer duration. To avoid entering passwords each time, we can set up an SSH passwordless login. It is important to note that we have to authenticate with the remote host for each new session. To terminate the session, we can use the exit command or ctrl+D key combination. Now onwards, we can execute the commands on the remote host just like the local system.

The SSH connection gets established after entering the correct password. In this example, we specified the login name using the -l option and the destination is 192.168.19.130. Let’s connect to the remote host using the ssh client: $ ssh -l root 192.168.19.130 Here, the square brackets () represent the optional arguments whereas angular brackets () represent the mandatory arguments. The syntax of the SSH command is as follows: $ ssh By default, the ssh utility is available on most Linux distributions. However, throughout this guide, we will use a command line utility called ssh. There are plenty of GUI and CLI-based clients available for Linux. We have to use an SSH client to interact with the remote host. We can use the SSH protocol to allow secure communication between the hosts. However, these are not secure due to the absence of encryption. There are various ways to interact with remote Linux hosts using protocols such as telnet, ftp, netcat, etc. In this section, we will discuss some of the popular use cases of the SSH protocol. It provides security by encrypting all communication between them. Secure Shell ( SSH) is a widely adopted network protocol, which allows us to interact with remote hosts in a secure way. We will also discuss commonly used SSH configurations that can be used in day-to-day life to boost your productivity. Brief: In this guide, we will discuss the common use cases of SSH.
