An Overview of SSH: Presentation To Linux Users of Victoria
An Overview of SSH: Presentation To Linux Users of Victoria
● The most common use of SSH (secure shell) is remote login access to
computer system. However, any network service can use ssh (e.g,. file transfers,
remote mounts, proxy server tunneling etc). It is built on a small mountain of
RFCs (4250-56, 4419, 4432, 6668 etc)
● The original reason for SSH is to provide a replacement for insecure remote
system applications such as telnet, rlogin, ftp etc. All of these send information
(e.g., passwords) in plain-text.
●PuTTY is a useful GUI SSH client which can also be used on MS-Windows. The
client is already installed on most systems; unless you want to login to your
system remotely you don’t need the server.
Installation and Management of OpenSSH
Server
● OpenSSH is commonly installed via package management (e.g., sudo apt-get
install openssh-server openssh-client). This will install the OpenSSH server and
start the daemon on port 22 by default.
`ssh-copy-id -i .ssh/id_rsa.pub
user@remote`
SSH Client Configuration Files
● If you have a range of hosts to connect to, different ports, multiple identity
keys etc, keeping track of these could be onerous. One method would be to
add them all as an alias in a login file (e.g., `alias spartan='ssh
lev@spartan.hpc.unimelb.edu.au').
●An even more elegant method however is to use an SSH config file, which
provides all the alias features, plus client-side configuration features (such as
keepalives). The ssh config file is kept in `~/.ssh/config` or
`/etc/ssh/ssh_config` for global settings. Config directives are subject to local
commands.
SSH config files plus passwordless SSH combined are very useful tools that
●
●When setting up an initial connection the possibility is raised that you might
be facing a man-in-the-middle attack (short example:
https://www.youtube.com/watch?v=4abglcnDBcY).
●However this can be circumvented because when new key pairs are created
they also create a unique fingerprint and ASCII-art image. When generating a
key for a new server (e.g., `ssh-keygen -t rsa -C newserver -f
.ssh/newserverkey`) save the key fingerprint and randomart image. Then you
can fetch a key's fingerprint and randomart image anytime to compare and
make sure they have not changed: (`ssh-keygen -lvf newserverkey` or for all of
them, `$ ssh-keygen -lvf ~/.ssh/known_hosts`).
● There have been several developments in parallel SSH which presumably will
become part of the mainstream in the future. The core idea is to read a hostfile
launch a command which is executed on the remote systems in the hostfile.
Technically these could be implmented as a loop but if the tasks take an
extended period of time...