How to install ssh service in Ubuntu Linux (12.04)

Check if sshd service is running in Ubuntu with the below command:


vbhadra@vbhadra-VirtualBox:~$ ps aux | grep ssh
vbhadra 1702 0.0 0.0 4088 204 ? Ss 11:49 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=ubuntu
vbhadra 4358 0.0 0.0 4400 824 pts/3 S+ 14:10 0:00 grep --color=auto ssh
vbhadra@vbhadra-VirtualBox:~$ sudo netstat -natp | grep sshd
vbhadra@vbhadra-VirtualBox:~$ sudo netstat -natp | grep ssh
vbhadra@vbhadra-VirtualBox:~$

The above command and their output shows there is no sshd service running on my Ubuntu Linux.

Now to install sshd (open ssh) in your system use the below command in Ubuntu Linux:


vbhadra@vbhadra-VirtualBox:~$ sudo apt-get install openssh-server openssh-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ssh-import-id
Suggested packages:
libpam-ssh keychain monkeysphere openssh-blacklist openssh-blacklist-extra rssh molly-guard
The following NEW packages will be installed
openssh-server ssh-import-id
The following packages will be upgraded:
openssh-client
1 to upgrade, 2 to newly install, 0 to remove and 317 not to upgrade.
Need to get 1,309 kB of archives.
After this operation, 896 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main openssh-client i386 1:5.9p1-5ubuntu1.10 [960 kB]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ precise-updates/main openssh-server i386 1:5.9p1-5ubuntu1.10 [343 kB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ precise/main ssh-import-id all 2.10-0ubuntu1 [6,598 B]
Fetched 1,309 kB in 0s (2,402 kB/s)
Preconfiguring packages ...
(Reading database ... 183976 files and directories currently installed.)
Preparing to replace openssh-client 1:5.9p1-5ubuntu1.4 (using .../openssh-client_1%3a5.9p1-5ubuntu1.10_i386.deb) ...
Unpacking replacement openssh-client ...
Selecting previously unselected package openssh-server.
Unpacking openssh-server (from .../openssh-server_1%3a5.9p1-5ubuntu1.10_i386.deb) ...
Selecting previously unselected package ssh-import-id.
Unpacking ssh-import-id (from .../ssh-import-id_2.10-0ubuntu1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Processing triggers for ufw ...
Setting up openssh-client (1:5.9p1-5ubuntu1.10) ...
Setting up openssh-server (1:5.9p1-5ubuntu1.10) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
ssh start/running, process 5043
Setting up ssh-import-id (2.10-0ubuntu1) ...

As this point the open-ssh has been installed in your system. You can now check if the service is up and running yet with the below set of commands:


vbhadra@vbhadra-VirtualBox:~$ sudo netstat -natp | grep ssh
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5043/sshd
tcp6 0 0 :::22 :::* LISTEN 5043/sshd
vbhadra@vbhadra-VirtualBox:~$ sudo netstat -natp | grep sshd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5043/sshd
tcp6 0 0 :::22 :::* LISTEN 5043/sshd
vbhadra@vbhadra-VirtualBox:~$ ps aux | grep ssh
vbhadra 1702 0.0 0.0 4088 204 ? Ss 11:49 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session gnome-session --session=ubuntu
root 5043 0.0 0.0 6696 2432 ? Ss 14:12 0:00 /usr/sbin/sshd -D
vbhadra 5088 0.0 0.0 4400 824 pts/3 S+ 14:13 0:00 grep --color=auto ssh

One thought on “How to install ssh service in Ubuntu Linux (12.04)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s