![]() | ![]() |
[3]This is true of standard Telnet, but some implementations add security features.
SSH completely avoids these problems. Rather than running the insecure telnet program, you run the SSH client program ssh. To log into an account with the username smith on the remote computer host.example.com, use this command:
Terminology: Networking
- Local computer ( local host, local machine)
- A computer on which you are logged in and, typically, running an SSH client.
- Remote computer (remote host, remote machine)
- A second computer you contact from your local computer. Typically, the remote computer is running an SSH server and is contacted via an SSH client. As a degenerate case, the local and remote computers can be the same machine.
- Local user
- A user logged into a local computer.
- Remote user
- A user logged into a remote computer.
- Server
- An SSH server program.
- Server machine
- A computer running an SSH server program. We will sometimes simply write "server" for the server machine when the context makes clear (or irrelevant) the distinction between the running SSH server program and its host machine.
- Client
- An SSH client program.
- Client machine
- A computer running an SSH client. As with the server terminology, we will simply write "client" when the context makes the meaning clear.
- ~ or $HOME
- A user's home directory on a Unix machine, particularly when used in a file path such as ~/filename. Most shells recognize ~ as a user's home directory, with the notable exception of Bourne shell. $HOME is recognized by all shells.
The client authenticates you to the remote computer's SSH server using an encrypted connection, meaning that your username and password are encrypted before they leave the local machine. The SSH server then logs you in, and your entire login session is encrypted as it travels between client and server. Because the encryption is transparent, you won't notice any differences between telnet and the telnet-like SSH client.$ ssh -l smith host.example.com
When transmitted by scp, the file is automatically encrypted as it leaves firstaccount.com and decrypted as it arrives on secondaccount.com.$ scp myfile metoo@secondaccount.com:
Although this method works, it's insecure. The results of /usr/ucb/w are transmitted as plaintext across the network; if you consider this information sensitive, the risk might be unacceptable. Worse, the rsh authentication mechanism is extremely insecure and easily subverted. Using the ssh command instead, you have:#!/bin/sh This is a shell script. for machine in grape lemon kiwi melon On each of these four machines in turn... do rsh $machine /usr/ucb/w invoke the "/usr/ucb/w" program, which done prints a list of all running processes.
The syntax is nearly identical, and the visible output is identical, but under the hood, the command and its results are encrypted as they travel across the network, and strong authentication techniques may be used when connecting to the remote machines.#!/bin/sh for machine in grape lemon kiwi melon do ssh $machine /usr/ucb/w Note "ssh" instead of "rsh" done
This says "ssh, please establish a secure connection from TCP port 3002 on my local machine to TCP port 119, the news port, on news.yoyodyne.com." So, in order to read news securely, configure your news-reading program to connect to port 3002 on your local machine. The secure tunnel created by ssh automatically communicates with the news server on news.yoyodyne.com, and the news traffic passing through the tunnel is protected by encryption. [Section 9.1, "What Is Forwarding?"]$ ssh -L 3002:localhost:119 news.yoyodyne.com