The Best Multiplatform Development Environment that Ever Lived on One Box
There are two versions of the SSH protocol: 1 and 2. I am using version 2 of the protocol (sometimes simply called SSH2). SSH (secure shell) gives me three advantages from a security standpoint:
High degree of authentication security using public key authentication
High degree of transmission security by encrypting all traffic after authentication
Encrypted TCP tunneling for connection to services not available to the public (often referred to as VPN or virtual private networking)
Public key authentication works through the use of a public key and a private key. A key in this context is a string of characters used to identify an individual. Keys can be a variety of lengths. The longer the key, the harder it is to break, but performance in the encryption and decryption process can suffer with longer keys. Usually a tool, such as ssh-keygen, is used to generate key pairs. Information encrypted with the private key can only be decrypted with the public key. Likewise, information encrypted with the public key can only be decrypted with the private key.
Once keys have been generated, they can be used in secure connections with SSH. The private key (as its name implies) should be kept secure at all times. Often it is kept on a floppy disk or other removable media when other people may have access to a machine you also use (I keep mine on a Java powered ibutton, but that is another story). The public key, however, may be distributed, well, publicly. A copy of the public key must be present on the remote server that you wish to connect to using SSH.
When you attempt to make a connection with SSH, a small bit of information is encrypted using your public key on the server. This information is called the session key. The SSH server on the remote machine sends the encrypted session key back to the client. The client then attempts to decrypt this bit of information using your private key. This information (once successfully decrypted) is then used to encrypt the rest of the session. This solution is simple and elegant. The information used later on to encrypt the rest of the session is never passed in cleartext over the insecure Internet.
One of the most powerful features of SSH is the ability to use TCP tunnels. There are two types of tunnels: local and remote. With a local tunnel, you specify a port for your local machine to listen on, as well as a remote machine and port on the other side of your SSH connection to connect to. Once a local tunnel is established, you can connect to the specified port on your local machine, and it will be as if you had connected to the remote machine on the port you specified for the tunnel. With remote tunnels, you specify a port for the remote machine to listen on and a local address and port to connect to. When a connection is made to the specified port on the remote machine, it will be as if the connection had been made to the local machine and port you specified for the tunnel. The way these connections work is not always understood, so let's take two examples from my own configuration file:
LocalForward "5521:localhost:1521" RemoteForward "6010:localhost:6000"
On the Linux box I run a database server. I want to be able to use the client tools remotely, but in a secure way. The listener service is bound to port 1521. In the first example above, the first parameter (5521) is the port that my local machine will listen on. The second and third parameters refer to the remote machine. So, localhost in this case is the remote machine's localhost. After establishing my secure shell session, the tunnels are automatically created from the configuration file. I can then point the client tools to my local machine at port 5521. All traffic generated by the client tools will transparently be forwarded over the secure tunnel to the remote machine.
The second example uses the X Window System over a secure tunnel. Without getting into too much detail, X is somewhat counter-intuitive; you run an X server on your local machine, and X clients are run on the remote machine. These clients connect to the X server. X has a notion of display numbers bound to ports. Display 0 uses port 6000, display 1 uses 6001 and so on. In the second example above, the first parameter (6010) refers to the port on the remote machine. In this case, I am using display 10, bound to port 6010, to run my X clients. The second and third parameters refer to my local machine. So, localhost in this case is my machine's localhost. On the remote machine, I might run a command like:
xterm -display localhost:10&
This will cause xterm to connect to port 6010, which will transparently connect through the secure tunnel to my machine on port 6000 (the default port for the X server).
In actuality, SSH supports automatically tunneling X clients.
Since the tunnel is established through an already secure connection, all information passing along the tunnel is encrypted. The upside is a high degree of security over a public and insecure network. The downside is overhead in encrypting everything on the fly.
Win an iPhone 6
Enter to Win
|Microsoft and Linux: True Romance or Toxic Love?||Nov 25, 2015|
|Non-Linux FOSS: Install Windows? Yeah, Open Source Can Do That.||Nov 24, 2015|
|Cipher Security: How to harden TLS and SSH||Nov 23, 2015|
|Web Stores Held Hostage||Nov 19, 2015|
|diff -u: What's New in Kernel Development||Nov 17, 2015|
|Recipy for Science||Nov 16, 2015|
- Non-Linux FOSS: Install Windows? Yeah, Open Source Can Do That.
- Cipher Security: How to harden TLS and SSH
- Microsoft and Linux: True Romance or Toxic Love?
- Simple Photo Editing, Linux Edition!
- Web Stores Held Hostage
- Firefox's New Feature for Tighter Security
- diff -u: What's New in Kernel Development
- It's a Bird. It's Another Bird!
- IBM LinuxONE Provides New Options for Linux Deployment
- November 2015 Issue of Linux Journal: System Administration