Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

blocked, you cannot use SSH. See Chapter 20, “Securing Your Machines,” for
help doing this.


Two different versions of SSH exist: SSH1 and SSH2. The latter is newer and
more secure, comes with more features, and is the default in Ubuntu. Support
for SSH1 clients is best left disabled so that older clients cannot connect. This
is done by default in the /etc/ssh /sshd_config file, on this line:


Protocol    2

If you have no other option and absolutely have to allow an older client to
connect, add this new line:


Protocol    1

SSH Tools


Many people are surprised to learn that OpenSSH actually is composed of a
suite of tools. You have already seen ssh, the Secure Shell command that
connects to other machines, and sshd, the SSH server daemon that accepts
incoming SSH connections. However, there is also sftp, a replacement for
ftp, scp, and rcp.


You should already be familiar with the ftp command because it is the
lowest common denominator system for handling FTP file transfers. Like
Telnet, though, ftp is insecure: It sends your data in plain text across the
network, and anyone can sniff your packets to pick out a username and
password. The SSH replacement, sftp, puts FTP traffic over an SSH link,
thus securing it.


The rcp command might be new to you, largely because it is not used much
anymore. Back in its day, rcp was the primary command for copying a single
file to another server. As with sftp and ftp, scp replaces rcp by simply
channeling the data over a secure SSH connection. The difference between
sftp and scp is that the former enables you to queue and copy many files
simultaneously, whereas the latter is usually used to send just one, although
scp can be used with the -r option to send an entire directory at once. See
the man page for details.


Using scp to Copy Individual Files Between


Machines

Free download pdf