Getting Started with Ubuntu: SSH

ubuntu-logo14

Here’s the first part of a blog series focused on getting started with Ubuntu, courtesy of Brent, one of our talented Ninjas. Check out part 2 here, and part 3 here

Ubuntu is quickly becoming a favorite among newcomers to GNU/Linux, and rightfully so- Canonical LTD. (the organization in charge of releasing Ubuntu) along with many, many volunteers have put a lot of work into making GNU/Linux accessible to people who may not be familiar with it.

GNU/Linux distributions (and other Unix-like operating systems) have a reputation, however; mostly that they’re hard to learn. Some of the older crowd may recall using MS-DOS commands as a necessary component to using their home PC.

With the growing popularity of PowerShell, however, administrators and power users alike are starting to re-discover just how powerful and flexible a command-line interface can be. GNU/Linux does certainly have “windowing systems” and various other GUIs (Graphical User Interface) available if pointing and clicking is more your style, but there is a lot you’re missing out on! If you’ve used MS-DOS commands or PowerShell then this should start to look like very familiar territory.

First, the default shell for most GNU/Linux distributions is BASH. Ubuntu uses this shell as well for the interactive user shell. Not sure what this means? Don’t worry- it’s not terribly important.

The important thing to remember is the shell is the connection between the user and the software. We can go into various shell commands in future articles, but I highly recommend any newcomer to system administration of Linux to purchase and keep handy the UNIX and Linux System Administration Handbook (4th Edition) by Evi Nemeth et. al. It will get you not only acquainted with various basic commands but also does a fantastic job of bringing you deeper and deeper into managing various *nix systems and understanding the internals of them.

SSH, Secure SHell, is something called a daemon (a software that runs persistently on a server, even with nobody using it, that listens for connections and then runs a task or program using these connections). It listens on port 22/TCP by default (this can be changed) and provides a very secure connection for someone off-site to connect remotely to the shell of the server. It’s sort of like a text-mode Remote Desktop. This allows you to manage one, several, or many machines remotely- as long as you and the server are able to connect over the Internet (or a local network, VPN, etc.), then you’re able to log into the machine and manage it.

Now, if you’re already using a Mac OS X or *nix desktop/laptop, you’re in luck- you already have an SSH client built-in!

Let’s say, for example, your server’s IP is 1.2.3.4:

Mac OS X:

  1. Open Terminal.app
  2. ssh root@1.2.3.4
  3. You’ll get a notice about the server’s public key. Type “yes” (without the quotes) and hit enter.
  4. Enter your password (it won’t display on the screen)

*nix:

  1. Open a terminal emulator of your choice (in recent version of Ubuntu, click the Ubuntu icon in the top left corner and search for Terminal)
  2. ssh root@1.2.3.4
  3. You’ll get a notice about the server’s public key. Type “yes” (without the quotes) and hit enter.
  4. Enter your password (it won’t display on the screen)

If you’re using Windows, there’s a bit more work involved.
Windows:

  1. Download the Windows Installer for PuTTY at PuTTY’s download page.
  2. At the very least you will need PuTTY and PuTTYgen installed, so be sure these are selected during installation.
  3. Open PuTTY (we’ll save puttygen for another article!), and in the “Host Name” field enter the IP address of your server (for our example, 1.2.3.4). The connection type should be SSH. If you wish, you may save the session as well for easy usage later.
  4. If this is your first time connecting, you’ll get a notice regarding the server’s public key. Click Accept.
  5. Log in with the username root and the password (it won’t display on the screen).

And congratulations! You should now be sitting at a prompt that looks a little like this:

Welcome to Ubuntu 12.04.3 LTS (GNU/Linux 3.2.0-43-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Tue Aug 27 18:46:29 UTC 2013

  System load:  0.0                Users logged in:       0
  Usage of /:   13.0% of 14.76GB   IP address for eth0:   1.2.3.4
  Memory usage: 6%                 IP address for eth0:1: X.X.X.X
  Swap usage:   0%                 IP address for eth1:   10.X.X.X
  Processes:    76

  Graph this data and manage this system at https://landscape.canonical.com/

Last login: Tue Aug 27 17:25:02 2013 from central.asmallorange.com
root@server:~#

Stay tuned for the second installment in this series next week!

One Response to Getting Started with Ubuntu: SSH

  1. james says:
    January 29, 2014 at 9:22 pm.

    this is what i love with having ubuntu as your workstation OS. when you work with servers, it’s seamless. you fireup a terminal and your local and remote are very similar

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>