A Basic Guide to SSH
By Tavis J. Hampton
In bygone days, a system administrator sat in a lonely server room filled with rack-mounted boxes. That sysadmin sat in front of the servers and monitored them like a facilities engineer monitoring a boiler. When something went wrong, the sysadmin got up and physically logged onto an attached console.
Those days are mostly long gone. Today's system administrators are mobile, social, and may never occupy the same room as the servers they monitor. Because of this reality, remote administration has become a necessity, and SSH is the primary medium for remote access on servers running Linux and other Unix-like operating systems.
When remote administration was not much of a concern, many sysadmins relied on Telnet. Often times this was done over an intranet, where the sysadmin may only be down the hall or across campus. When remote administration became a long distance affair, Internet security was suddenly a new priority. Telnet was easy to hack, and servers that used it were vulnerable.
SSH or Secure Shell uses secure encryption for data exchange. As a result, it is more difficult for hackers with malicious intent to gain access to a server or intercept sensitive data.
Gaining Access
If you have physical access to your server and want to be able to connect to it remotely, you may need to install and enable SSH. Most Linux distributions have packages for OpenSSH client and server in their repositories. If it is not already installed, you can install it and have it up and running in a matter of minutes.
For remote server hosting, like the type offered by dedicated host 34SP.com, your provider will already have SSH enabled by default, as it will be your first and primary means of accessing your server. To connect, use the username and password supplied to you when you signed up for your account. The same applies to virtual private servers (VPS). For anything less than a VPS, such as shared hosting, you will most likely not have SSH access at all. This is a security precaution taken by your host.
Linux, BSD, and Mac OS X desktop and laptop computers come with SSH clients. To begin using them, just open a terminal window. Windows does not come with SSH support, but there are a number of free programs, such as PuTTY and WinSCP that will work.
Once you have a terminal window ready, simply type the following:
ssh -u username hostname
Replace "username" with the default username for your server (NOT the root username). For "hostname", use your domain or IP address. If the connection is accepted, SSH will prompt you for a password. Enter it, and it should bring up a Linux command prompt with a "$" symbol.
Using the Linux/Unix Shell
Once you are logged in, you will have access to a wide variety of shell commands. It is important to note that, at this point, you are logged in as a regular user with limited permissions. This is a security measure. Under no circumstances should you ever log into your server directly as the "root" administrative user. In fact, you should configure SSH to not even accept direct root logins.
Having said that, there are circumstances when you will need root access. For that, there is a simple tool called "superuser" or "su". To use it, simply type:
su
Press enter, and you will be prompted for the root password. Enter it, and your prompt should change to "#", indicating that you are logged in as root.
SSH Security
Although SSH uses encryption, security also depends on your diligence. Never give your SSH password to anyone, and make sure your password is strong. Use a combination of mixed-case letters, numbers, and avoid dictionary words.
Because SSH provides a secure layer for exchanging data, you can use it for connections other than the standard shell. For example, SFTP allows you to use SSH to transfer files securely. You may come to prefer this method to regular FTP, which is not secure. There are desktop software options for most operating systems that support SFTP for file transfer. Examples are FileZilla and Cyberduck (for Mac OS X).
SSH is a powerful tool, and this guide just begins to scratch the surface of what you can accomplish with it. For more information about SSH, consult your server's documentation and read books such as SSH The Secure Shell: The Definitive Guide (ISBN 9780596008956).
About the author, Tavis J. Hampton -
Tavis J. Hampton is a librarian and writer with a decade of experience in information technology, web hosting, and Linux system administration. He currently works for LanternTorch.Net, which offers writing, editing, tech training, and information architecture services.
Visit the Author's Website
(Published 11/30/2010, )
Link to this article: (Select text below and copy to your clipboard)
Reach Our Readers!Submit your Web Hosting, Development, related stories and editorials: Click Here
