Installing OpenSSH on Ubuntu Linux (SSH Part 1)

Secure Shell (SSH) is a protocol that uses encryption to create a secure channel from a local computer to a remote computer. It is primarily used to execute commands on a remote host via a terminal session. In addition, it allows for tunneling and file transfer. It’s a handy little tool that allows remote access with a fair sense of security. It’s very simple to install on Ubuntu with the Advanced Packaging Tool (APT).


(*note: Commands preceded by a “$” are run as a normal user and commands preceded by a “#” are run as root.)

The first thing we need to do is become root. Issue the following command from a command prompt:

$ su

installing_openssh_on_ubuntu_linux0.png

Enter your root password when prompted.

installing_openssh_on_ubuntu_linux1.png

If successful, you will be returned to the command prompt with root privileges.

installing_openssh_on_ubuntu_linux2.png

Before we use the apt command it is usually a good idea to update the available package database. That’s done with the following command:

# apt-get update

installing_openssh_on_ubuntu_linux3.png

Package information will be downloaded from apt’s sources and will then be merged into the available package database. If this command doesn’t complete without error try running it again and see if it finishes cleanly.

installing_openssh_on_ubuntu_linux4.png

Now you’re ready to install OpenSSH. We’ll let apt do all the work for us. Just issue the following command:

# apt-get install ssh

installing_openssh_on_ubuntu_linux5.png

Apt will not only install OpenSSH but it also determines if there are any dependencies that are required. If so, it will install them as well. You may be prompted to confirm the installation. Press “Y” to continue.

installing_openssh_on_ubuntu_linux6.png

Apt will proceed to download the necessary files, run the installation scripts, and generate the necessary encryption keys for your system. Once done the ssh service will be started.

installing_openssh_on_ubuntu_linux7.png

You’re all done, lets exit out of the root session.

# exit

installing_openssh_on_ubuntu_linux8.png

No more root session for us….

installing_openssh_on_ubuntu_linux9.png

We’re done for now… time to logout.

$ exit

installing_openssh_on_ubuntu_linux10.png

Nicely done!

installing_openssh_on_ubuntu_linux11.png

Continue on to the second half of this tutorial: Using Putty to Access a Remote Host (SSH Part 2)

Tags: , , , , ,

5 Comments so far »

  1. andrew said,

    Wrote on December 22, 2007 @ 8:03 am

    nice tutorial…i’m very2 love it..

  2. Steve Bragg said,

    Wrote on February 5, 2008 @ 6:43 pm

    This does not work on Gutsy Gibbon. It just screams, “Couldn’t find package ssh”.

    Rats. Another hour down the Linux black hole…

  3. Jeremy said,

    Wrote on February 19, 2008 @ 12:12 pm

    Hey JR

  4. 3R1C0 said,

    Wrote on June 4, 2008 @ 4:30 am

    Fabulous !

    Tank’s

  5. Cian Muldoon said,

    Wrote on July 24, 2008 @ 4:04 am

    Steve try:

    sudo apt-get install openssh-client
    sudo apt-get install openssh-server

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment: