Ubuntu Linux OpenSSH Server installation and configuration

last updated in Categories , , , ,

Q. I have just installed Ubuntu 6.06 and I would like to allow remote login to my system from home via ssh. How do I install and configure SSH server?


A. OpenSSH is a FREE version of the SSH connectivity tools that technical users of the Internet rely on. Users of telnet, rlogin, and ftp may not realize that their password is transmitted across the Internet unencrypted, but it is. OpenSSH encrypts all traffic (including passwords) to effectively eliminate eavesdropping, connection hijacking, and other attacks. Additionally, OpenSSH provides secure tunneling capabilities and several authentication methods, and supports all SSH protocol versions.

Ubuntu SSHD Installation

Type the following two command to install both ssh client and server:
# sudo apt-get install openssh-server openssh-client

SSHD Configuration

To be frank your server is ready by default. Just test it from your home computer or from same system with the command:
# ssh localhost
# ssh user@your-server-ip-address

How do I use ssh client?

Assuming that your server hostname is userver.mydomain.com and username is vivek, you need to type the following command:
# ssh vivek@userver.mydomain.com
To stop ssh server, enter:
# sudo /etc/init.d/ssh stop
To start sshs server, enter:
# sudo /etc/init.d/ssh start
To restart ssh server, enter:
# sudo /etc/init.d/ssh restart

See also:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


34 comment

  1. where can I find my ip address, I use the wireless network provided to me by my college.
    when I do
    I get
    eth1 inet addr:10.XXX.XXX.XXX
    lo inet addr:XXX.XXX.XXX.XXX

    now from remote, when I try
    ssh @10.XXX.XXX.XXX
    its refuse to except my password.

    also, from the other blog, i edited /etc/ssh/sshd_config file and I added line

    but its still not working. which IP address I am suppose to use.
    also, when I open a website, which gives IP address, it shows my IP address as
    which is different from 10.XXX.XXX.XXX which i get using “ifconfig”

  2. Devvrath: Use your external ip, not the local ip, if both you and the server is localy, you can connect to the lokalip of the server, if your not local, use the external ip,

  3. thanks for the quality information
    however mine still not working
    it displays package not available

  4. Hey all, I can’t seem to get my SSH to let other people connect. It works fine for any local computer on the network but if you try connecting VIA the internet it has connection errors. Does anyone know why? I was told my tunneling needs to be set so i just set tunneling to YES and it still doesn’t work…

    Thanks alot! Mikey

  5. for home user that’s using DSL/ADSL/similar router, make sure that the port is forwarded to your machine.

    for other version that cant run, not sure if this will work:
    sudo apt-get update

    possibly the record in your ubuntu is not updated yet…

  6. I got a problem while establishing Lan between two computers in my room using SSH….
    From one computer i can access other, but i cant do the same from the other computer… it gives an error – Cannot display location “sftp://” connection refused by server……. what shd be done please help me out???

  7. Hi
    If I follow the steps also it is giving some unrelated error.

    To access official Ubuntu documentation, please visit:

    0 packages can be updated.
    0 updates are security updates.

    Last login: Sat May 15 22:34:21 2010 from ash-laptop

    Error: Unknown option msgbox.
    Use –help to list options.

    what should i do ? can u please help me up?

  8. Installed and works like a charm but how to put ssh daemon in the service so i can start or stop using service sshd start/stop

  9. when i gave ssh local ,it gave me error as
    Couldn’t establish connection to proxy: Network is unreachable
    ssh_exchange_identification: Connection closed by remote host

    what to do?

  10. hi i am testing SSH on linux and i am having problem connecting to the Linux SERVER. i have a client PC running Putty (shh) and a Linux SSH server (bear box modem). when i try to connect to the SSH server via a PC running Putty connected to my 3G modem i get network error: timeout. Linux box is also connected to a 3G rooter with port 22 forwarded.

    when i connect to a PC loaded with Unix or Windows running and loaded with SSH server, i can connet fine with no hassle. using the same setup

    can you please help

  11. Why not use a utility service with ‘ # sudo service ssh start’ which is more better than initiating init script from a folder with # sudo /etc/init.d/ssh start?

  12. I installed and now doing a upgrade. My question is. If i want to conenct to it through my local network usign putty cleint. Would i just put in localhost in the host name or do i still have to put in a ip because would that not just try and connect me back to the computer im on or no? or do i use the locak ip for the machine im running my server on? Thanks. also for blind users is there a pack to use for voice to read me what is going on? I was thinking there was but forget how to get it or install it. Any help would be great.

Leave a Comment