Running commands on a remote host with SSH
SSH stands for Secure Shell. It connects two computers across an encrypted tunnel. SSH gives you access to a shell on a remote computer where you can interactively run a single command and receive the results or start an interactive session.
Getting ready
SSH doesn't come preinstalled with all GNU/Linux distributions. You may have to install the openssh-server
and openssh-client
packages using a package manager. By default, SSH runs on port number 22
.
How to do it...
- To connect to a remote host with the SSH server running, use the following command:
$ ssh username@remote_host
The options in this command are as follows:
-
username
is the user that exists at the remote host
remote_host
can be the domain name or IP address
Consider this example:
$ ssh [email protected] The authenticity of host '192.168.0.1 (192.168.0.1)' can't be established. RSA key fingerprint is 2b:b4:90:79:49:0a:f1:b3:8a:db:9f:73:2d:75:d6...