How to Install Secure Shell/ OpenSSH Server on Ubuntu 12.04


This tutorial shows you how to install, enable and configure Secure Shell (SSH)/ OpenSSH server on Ubuntu 12.04 Server. SSH lets you communicate between two networked computers securely. Because SSH is more secure than Telnet, it is recommended that you use SSH instead of Telnet to communicate, and this tutorial will show you how to install and use it in Ubuntu 12.04

OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on.

Installing OpenSSH

To install the OpenSSH server application, and related support files, use this command at a terminal prompt:

[root@php2s ~]# sudo apt-get install openssh-server

To install the OpenSSH client applications on your Ubuntu system, use this command at a terminal prompt:

[root@php2s ~]# sudo apt-get install openssh-client

After installing, you may configure SSH Server by running the command below to OpenSSH config file.

[root@php2s ~]# gksu gedit /etc/ssh/sshd_config

Make all the changes in here and save the file. For instance, the default port SSH listens on is 22. Most SSH severs are set to communicate in Protocol Version 2. You could limit the IP Address SSH Server communicates on by uncommenting ( # ) line ListenAddress x.x .x.x and specifying the IP Address.

You might also want to check the following settings:

RSAAuthentication == YES
Protocol == 2 (make sure this is not a ’1′)
PasswordAuthentication == YES (only if you have not done the Key Authentication part below)
AllowUsers == make sure the users you want to access the machine are in here
PermitRootLogin == NO

Then restart the sshd server:

[root@php2s ~]# sudo /etc/init.d/ssh restart

Save the file when done. Try connecting from a remote computer.

Use the following command to connect to server

ssh user@your-server-ip-address

[root@php2s ~]# ssh frank@

Here the Ubuntu Server ip is, username frank. Put your own server ip to connect.

How do I use a client to connect Server

Assuming that your server hostname is php2s, host ip address and username is frank, you need to type the following command:

# ssh frank@php2s
# ssh frank@

Lets Set a Hostname for client login
By now you’re no doubt getting sick of typing frank@ or whatever. It sure would be nice to type something shorter. Let’s fix that.

OpenSSH uses a client configuration file, located at ~/.ssh/config, to simplify some of the tedious typing associated with logging into remote machines. To edit (or create) that file, we’ll use the nano text editor, but you can use vi, emacs, kate or whatever:

nano ~/.ssh/config

The simplest configuration file might look something like this:

Host php2s

This associates the Host php2s with the HostName (or IP address), so now to login you’ll only need to type:

ssh frank@php2s

That’s cool, but let’s add more config to make life more easier, How about this:

Host php2s
User frank

Now all we need to type is:

[root@php2s ~]# ssh php2s

Far out! You can add as much configuration data as you need to this Host, and as many different Hosts as you like. And this shorthand will also work with all the scp examples:

scp file.txt php2s:

To learn more visit the OpenSSH docs, or run man ssh_config.

How to Stop, Start & Restart
To stop ssh server, enter:

[root@php2s ~]# sudo /etc/init.d/ssh stop

To start sshs server, enter:

[root@php2s ~]# sudo /etc/init.d/ssh start

To restart ssh server, enter:

[root@php2s ~]# sudo /etc/init.d/ssh restart

 How to Install Secure Shell/ OpenSSH Server on Ubuntu 12.04

About Frank Boros

Frank Boros has written 107 post in this blog.

Incoming search terms:

Be Sociable, Share!
  • more How to Install Secure Shell/ OpenSSH Server on Ubuntu 12.04

    You can leave a response, or trackback from your own site.

    Leave a Reply

    × four = 28

    Powered by WordPress | Designed by: best suv | Thanks to trucks, infiniti suv and toyota suv
    WP Socializer Aakash Web
    promotepoint's Profile on