Results 1 to 8 of 8

Thread: SSH Connection Lost / Refused

  1. #1
    Join Date
    Jan 2010
    Beans
    13

    Smile SSH Connection Lost / Refused

    Hello,

    I found a tutorial online on setting up Opensshd-server.
    everything works fine when I try ssh user@localhost

    but when I try to connect though another computer on the network it gives me:

    Connection Lost
    pool-my-ip-address.plspca.dsl-w.verizon.net/my.ip.address:22 - Connection Refused

    i also tried different ports which I have forwarded on my router but it doesn't connect. I would really appreciate some help

    thanks in advance

  2. #2
    Join Date
    Jan 2011
    Location
    India
    Beans
    253
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: SSH Connection Lost / Refused

    First check if you are able to ping the server or not from your local machine.
    Code:
    ping hostname or IP
    If that works, try following things on server-

    First check if the ssh is running on the server or not -

    Code:
    sudo service ssh status
    Also check the default ssh port of the server if it is in listening or not

    Code:
    netstat -tuln
    You can create following rule on iptables of server to allow the connections on port 22 (Default SSH Port)

    Code:
    iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
    iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
    eth0 is network interface device, change it accordingly if you have something else like eth1, eth2....

  3. #3
    Join Date
    Dec 2011
    Location
    The Netherlands
    Beans
    1,087
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: SSH Connection Lost / Refused

    Quote Originally Posted by maverickaddicted View Post
    First check if you are able to ping the server or not from your local machine.
    Code:
    ping hostname or IP
    If that works, try following things on server-

    First check if the ssh is running on the server or not -

    Code:
    sudo service ssh status
    Also check the default ssh port of the server if it is in listening or not

    Code:
    netstat -tuln
    You can create following rule on iptables of server to allow the connections on port 22 (Default SSH Port)

    Code:
    iptables -A INPUT -i eth0 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT
    iptables -A OUTPUT -o eth0 -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT
    eth0 is network interface device, change it accordingly if you have something else like eth1, eth2....
    Uh.... The service of opensshd is called sshd not ssh.
    "Everything that has a beginning, has an end." --an unexpectedly wise wallpaper

  4. #4
    Join Date
    Jan 2011
    Location
    India
    Beans
    253
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: SSH Connection Lost / Refused

    Quote Originally Posted by roelforg View Post
    Uh.... The service of opensshd is called sshd not ssh.
    I use ssh only that's why I have written it like that -
    Code:
    serveradmin@openserver:~$ sudo service sshd status
    sshd: unrecognized service
    serveradmin@openserver:~$ sudo service ssh status
    ssh start/running, process 1063
    serveradmin@openserver:~$ ssh -v
    OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
    usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
               [-D [bind_address:]port] [-e escape_char] [-F configfile]
               [-i identity_file] [-L [bind_address:]port:host:hostport]
               [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
               [-R [bind_address:]port:host:hostport] [-S ctl_path]
               [-w local_tun[:remote_tun]] [user@]hostname [command]
    serveradmin@openserver:~$

  5. #5
    Join Date
    Dec 2011
    Location
    The Netherlands
    Beans
    1,087
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: SSH Connection Lost / Refused

    Quote Originally Posted by maverickaddicted View Post
    I use ssh only that's why I have written it like that -
    Code:
    serveradmin@openserver:~$ sudo service sshd status
    sshd: unrecognized service
    serveradmin@openserver:~$ sudo service ssh status
    ssh start/running, process 1063
    serveradmin@openserver:~$ ssh -v
    OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009
    usage: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
               [-D [bind_address:]port] [-e escape_char] [-F configfile]
               [-i identity_file] [-L [bind_address:]port:host:hostport]
               [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
               [-R [bind_address:]port:host:hostport] [-S ctl_path]
               [-w local_tun[:remote_tun]] [user@]hostname [command]
    serveradmin@openserver:~$
    I accidentally confused the service name with the deamon name (which *is* sshd).
    "Everything that has a beginning, has an end." --an unexpectedly wise wallpaper

  6. #6
    Join Date
    Jan 2011
    Location
    India
    Beans
    253
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: SSH Connection Lost / Refused

    Quote Originally Posted by roelforg View Post
    I accidentally confused the service name with the deamon name (which *is* sshd).
    Thank You, I didn't know that.

  7. #7
    Join Date
    Dec 2011
    Location
    The Netherlands
    Beans
    1,087
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: SSH Connection Lost / Refused

    Quote Originally Posted by maverickaddicted View Post
    Thank You, I didn't know that.
    Yeah, sshd is the deamon (it's short for ssh deamon) and ssh is the client.
    Guess why i got confused.
    "Everything that has a beginning, has an end." --an unexpectedly wise wallpaper

  8. #8
    Join Date
    Jan 2010
    Beans
    13

    Re: SSH Connection Lost / Refused

    Thanks guys! this really helped, I got it to work. =D

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •