|
This tutorial is about SSH and SCP. You will learn how to connect to a
remote host and how to copy between hosts. This tutorial also documents a few
important differences between the commands.
Difficulty: Basic
Before we start: in this tutorial, you will come across both SSH and
ssh. The difference is this: SSH is the general protocol, and ssh is the linux
SSH client command.
SSH
SSH is some kind of an abbreviation of Secure SHell. It is a protocol that
allows secure connections between computers. In this tutorial, we'll be dealing
with the ssh command on Linux, the OpenSSH version. Most Linux distributions
feature the OpenSSH client today, but if you want to be sure, have a look at
the SSH manpage on your system. You can do this by typing:
[user1@linuxmachine~]$ man ssh
|
Note: this should be done in a terminal. This tutorial assumes that you
have some basic terminal knowledge, like knowing how to start a terminal
session on your system and being familiar with the basic commands and syntaxes.
If it displays something like this
NAME ssh - OpenSSH SSH client (remote login program) |
then you can be quite sure you're running the OpenSSH version. For more
background information about SSH, see http://en.wikipedia.org/wiki/SSH.
The most simple case
In the most simple case, you can connect to a server that supports ssh with
a syntax as short as this:
| [user1@linuxmachine~]$ ssh serverToConnect |
Note: If you do not have any ssh server nearby that you can access, you
can also try this command with your own computer as a server. To do this,
replace "serverToConnect" with "localhost".
Of course, serverToConnect should be replaced by a hostname or an ip address of
the server you want to connect to. As you can see in the terminal snippet, I am
logged in as user1. If you do not specify a username (I'll explain how to do
that later in this tutorial), SSH will assume that you want to login with the
username you're currently logged in with. So, in this case, SSH will try the
username user1.
Also, you need to be sure
that the server supports ssh connections. The default port the ssh
client trıes to connect to is 22. You will find more regarding the SSH port further in this tutorial.
|