Installing ssh under Ubuntu / Debian Linux


You need to use the apt-get or aptitude command to install OpenSSH server under Debian Linux. Open a terminal and type the following command to update package database as root user:

# apt-get update

Type the following command to intall:

# apt-get install openssh-server

Sample outputs:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  ssh-askpass rssh molly-guard ufw
The following NEW packages will be installed:
  openssh-server
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 318 kB of archives.
After this operation, 717 kB of additional disk space will be used.
Get:1 http://mirror.anl.gov/debian/ squeeze/main openssh-server amd64 1:5.5p1-6+squeeze1 [318 kB]
Fetched 318 kB in 3s (89.0 kB/s)
Preconfiguring packages ...
Selecting previously deselected package openssh-server.
(Reading database ... 153448 files and directories currently installed.)
Unpacking openssh-server (from .../openssh-server_1%3a5.5p1-6+squeeze1_amd64.deb) ...
Processing triggers for man-db ...
Setting up openssh-server (1:5.5p1-6+squeeze1) ...
Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Restarting OpenBSD Secure Shell server: sshd.

By default openssh will run on the TCP port 22. You can verify the same with the following command:

# netstat -tulpn | grep :22

Sample Output:

tcp        0      0 0.0.0.0:22       0.0.0.0:*    LISTEN  3946/sshd
tcp6       0      0 :::22            :::*         LISTEN  3946/sshd

Type the following commands as root user to start/stop/restart ssh server:

# service ssh stop
# service ssh start
# service ssh restart
# service ssh status

OR

# /etc/init.d/ssh stop
# /etc/init.d/ssh start
# /etc/init.d/ssh restart
# /etc/init.d/ssh status

Source: http://www.cyberciti.biz

Tags: , , , ,

Comments & Responses

Leave a Reply

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

*


4 × 2 =

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>