Chapter 13. Remote access

Table of Contents

Inherent problems with telnet
SSH
Public and Private Key Infrastructure
Sample Session for Generating a key
Sample Session for Accepting a fingerprint
Sample Session for Verifying a fingerprint
Sample Session Using ssh agent
Sample Session to destroy your public/private key pair
FTP
Exercises:

How do we make connections to our Linux machines?

We essentially have a network and we could have one or more Linux machines on these networks, so the question is how do we connect between machines A and machine B?

Inherent problems with telnet

In the old days you had a protocol or an application called telnet.

Telnet's responsibility was to connect between one and another machine, connecting across a network or across the Internet.

As the industry demands more security telnet becomes more and more outdated, this is primarily because telnet sends your password with text across the network and if you are at all astute, it's relatively easy to sniff the network and collect any telnet password.

So although telnet is still available a systems administrator would probably avoid using telnet at all costs.

On a Linux machine check whether telnet is running by telnet-ing into a local host, say port 23. If you route the port, you should be able to see whether telnet is running.

Now depending on which Linux distribution you are using, telnet is enabled or disabled, by default. It seems that Debian comes with telnet enabled.

Again generally that's not a good idea to allow anybody to telnet your machine because the minute you allow one-person access, of course his or her password is going over the network in clear text format and it's easy enough to sniff and that user becomes compromised.

Let's talk about the telnet clients, which is quite useful knowledge for things other than telnet itself. We would use a telnet client in the following examples:

1.When we connect to our SMTP server earlier where we did a telnet to the SMTP server on pert 25. And what did that do? Well, that connected us to our SMTP server and we were able to have a conversation with our SMTP server via our telnet client.

2.Similarly we could have done a telnet to our POP mail server on port 110 and that would have shown us a POP session and we could have logged in and seen what mail was waiting for us from a POP perspective.

Now you've seen that Debian enables POP, IMAP, telnet and the finger and all sorts of other services by default so part of this chapter we'll be switching these services off. This involves editing the /etc/inetd.conf file, and commenting out the services that we do not require.

So what do we have if we don't have telnet?