SSH refusing connection - “sshd: unrecognized service”












11















I am having an issue with SSH.



ssh: connect to host 192.168.1.7 port 22: Connection refused


I get the above error whenever I try to connect my desktop with another desktop using SSH, but I'm able to ping the other desktop successfully.



ssh: connect to host 192.168.1.7 port 22: Connection refused


When I attempt to restart sshd, it outputs the following error



sshd: unrecognized service


I can connect to remote server using SSH, but I'm not able to connect within the local network. How can I solve this issue?










share|improve this question

























  • Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)?

    – david6
    Feb 13 '13 at 7:42






  • 1





    How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ?

    – Jeremy Kerr
    Feb 13 '13 at 7:43











  • @david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal.

    – Nathan J. Brauer
    Feb 13 '13 at 9:18











  • Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me...

    – Rudra
    Feb 13 '13 at 9:19











  • Confirm if you are using a firewall. Is SSH server installed on each target host?

    – david6
    Feb 13 '13 at 10:39
















11















I am having an issue with SSH.



ssh: connect to host 192.168.1.7 port 22: Connection refused


I get the above error whenever I try to connect my desktop with another desktop using SSH, but I'm able to ping the other desktop successfully.



ssh: connect to host 192.168.1.7 port 22: Connection refused


When I attempt to restart sshd, it outputs the following error



sshd: unrecognized service


I can connect to remote server using SSH, but I'm not able to connect within the local network. How can I solve this issue?










share|improve this question

























  • Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)?

    – david6
    Feb 13 '13 at 7:42






  • 1





    How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ?

    – Jeremy Kerr
    Feb 13 '13 at 7:43











  • @david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal.

    – Nathan J. Brauer
    Feb 13 '13 at 9:18











  • Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me...

    – Rudra
    Feb 13 '13 at 9:19











  • Confirm if you are using a firewall. Is SSH server installed on each target host?

    – david6
    Feb 13 '13 at 10:39














11












11








11


3






I am having an issue with SSH.



ssh: connect to host 192.168.1.7 port 22: Connection refused


I get the above error whenever I try to connect my desktop with another desktop using SSH, but I'm able to ping the other desktop successfully.



ssh: connect to host 192.168.1.7 port 22: Connection refused


When I attempt to restart sshd, it outputs the following error



sshd: unrecognized service


I can connect to remote server using SSH, but I'm not able to connect within the local network. How can I solve this issue?










share|improve this question
















I am having an issue with SSH.



ssh: connect to host 192.168.1.7 port 22: Connection refused


I get the above error whenever I try to connect my desktop with another desktop using SSH, but I'm able to ping the other desktop successfully.



ssh: connect to host 192.168.1.7 port 22: Connection refused


When I attempt to restart sshd, it outputs the following error



sshd: unrecognized service


I can connect to remote server using SSH, but I'm not able to connect within the local network. How can I solve this issue?







networking ssh 12.10 sshd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 20 at 21:00









Zanna

50.7k13136241




50.7k13136241










asked Feb 13 '13 at 7:06









RudraRudra

176238




176238













  • Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)?

    – david6
    Feb 13 '13 at 7:42






  • 1





    How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ?

    – Jeremy Kerr
    Feb 13 '13 at 7:43











  • @david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal.

    – Nathan J. Brauer
    Feb 13 '13 at 9:18











  • Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me...

    – Rudra
    Feb 13 '13 at 9:19











  • Confirm if you are using a firewall. Is SSH server installed on each target host?

    – david6
    Feb 13 '13 at 10:39



















  • Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)?

    – david6
    Feb 13 '13 at 7:42






  • 1





    How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ?

    – Jeremy Kerr
    Feb 13 '13 at 7:43











  • @david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal.

    – Nathan J. Brauer
    Feb 13 '13 at 9:18











  • Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me...

    – Rudra
    Feb 13 '13 at 9:19











  • Confirm if you are using a firewall. Is SSH server installed on each target host?

    – david6
    Feb 13 '13 at 10:39

















Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)?

– david6
Feb 13 '13 at 7:42





Please provide the command line you are using, or the application. Also add the Ubuntu version. Are these two desktops on the same LAN (local network)?

– david6
Feb 13 '13 at 7:42




1




1





How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ?

– Jeremy Kerr
Feb 13 '13 at 7:43





How are you trying to start the ssh daemon? You should be using sudo service ssh start. If that doesn't work, could you post the output of ls -l /etc/init/ssh.conf ?

– Jeremy Kerr
Feb 13 '13 at 7:43













@david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal.

– Nathan J. Brauer
Feb 13 '13 at 9:18





@david6, if they weren't on the same LAN, then the connection would just fail or be blackhole'd. He's getting a refused connection which means that a computer saw the request and sent back a refusal.

– Nathan J. Brauer
Feb 13 '13 at 9:18













Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me...

– Rudra
Feb 13 '13 at 9:19





Im using Ubuntu 12.10, where I need to ssh to another computer within the same local network. But, I'm able to connect to a remote server in another network. Please help me...

– Rudra
Feb 13 '13 at 9:19













Confirm if you are using a firewall. Is SSH server installed on each target host?

– david6
Feb 13 '13 at 10:39





Confirm if you are using a firewall. Is SSH server installed on each target host?

– david6
Feb 13 '13 at 10:39










6 Answers
6






active

oldest

votes


















14














Try un-installing and then installing openssh-server:



sudo apt-get remove openssh-client openssh-server


and then



sudo apt-get install openssh-client openssh-server


This worked for me. If you still can not connect, try



sudo ufw status verbose


and let us know what the output is.






share|improve this answer
























  • I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

    – Nishant
    Nov 25 '14 at 14:26





















6














First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system.



sudo apt-get install openssh-server


If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.






share|improve this answer


























  • When I restart the ssh it stops first and starts with a PID no.

    – Rudra
    Feb 13 '13 at 9:20











  • Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

    – Br. Sayan
    Jun 13 '17 at 11:40



















0














In my installation of Ubuntu 14.04 LTS desktop edition from the Ubuntu website, openssh-server is not installed by default. BIG FAT THUMBS DOWN Canonical!!!!! The installation is relatively easy and has been mentioned already by other answers above:



sudo apt-get update && sudo apt-get upgrade && sudo apt-get install openssh-server






share|improve this answer



















  • 1





    Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

    – ps95
    May 9 '15 at 7:43



















0














Check to make sure your router either, can accept ssh or has it enabled somewhere in the settings. Sometimes something this simple can be overlooked.






share|improve this answer































    0















    1. Goto vim /etc/ssh/sshd_config



    2. Change the Authentication "PermitRootLogin" to "yes"



      Eg:



      Authentication:

      PermitRootLogin yes


    3. service sshd restart







    share|improve this answer

































      0














      Check if you have SSH server installed:



      dpkg -l openssh-server


      If not, install it:



      sudo apt update && sudo apt install -y ssh


      Now check if your 22 port is in use:



      netstat -atn | grep :22





      share|improve this answer






















        protected by Zanna Jan 21 at 9:01



        Thank you for your interest in this question.
        Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



        Would you like to answer one of these unanswered questions instead?














        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        14














        Try un-installing and then installing openssh-server:



        sudo apt-get remove openssh-client openssh-server


        and then



        sudo apt-get install openssh-client openssh-server


        This worked for me. If you still can not connect, try



        sudo ufw status verbose


        and let us know what the output is.






        share|improve this answer
























        • I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

          – Nishant
          Nov 25 '14 at 14:26


















        14














        Try un-installing and then installing openssh-server:



        sudo apt-get remove openssh-client openssh-server


        and then



        sudo apt-get install openssh-client openssh-server


        This worked for me. If you still can not connect, try



        sudo ufw status verbose


        and let us know what the output is.






        share|improve this answer
























        • I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

          – Nishant
          Nov 25 '14 at 14:26
















        14












        14








        14







        Try un-installing and then installing openssh-server:



        sudo apt-get remove openssh-client openssh-server


        and then



        sudo apt-get install openssh-client openssh-server


        This worked for me. If you still can not connect, try



        sudo ufw status verbose


        and let us know what the output is.






        share|improve this answer













        Try un-installing and then installing openssh-server:



        sudo apt-get remove openssh-client openssh-server


        and then



        sudo apt-get install openssh-client openssh-server


        This worked for me. If you still can not connect, try



        sudo ufw status verbose


        and let us know what the output is.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 30 '13 at 18:33









        user1521587user1521587

        1514




        1514













        • I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

          – Nishant
          Nov 25 '14 at 14:26





















        • I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

          – Nishant
          Nov 25 '14 at 14:26



















        I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

        – Nishant
        Nov 25 '14 at 14:26







        I am having the same problem and the output of sudo ufw status verbose is status: inactive , so I enabled it but the error persists, this is the new output Status: active Logging: off Default: deny (incoming), allow (outgoing) New profiles: skip To Action From -- ------ ---- 22 ALLOW IN Anywhere 22 ALLOW IN Anywhere (v6)

        – Nishant
        Nov 25 '14 at 14:26















        6














        First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system.



        sudo apt-get install openssh-server


        If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.






        share|improve this answer


























        • When I restart the ssh it stops first and starts with a PID no.

          – Rudra
          Feb 13 '13 at 9:20











        • Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

          – Br. Sayan
          Jun 13 '17 at 11:40
















        6














        First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system.



        sudo apt-get install openssh-server


        If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.






        share|improve this answer


























        • When I restart the ssh it stops first and starts with a PID no.

          – Rudra
          Feb 13 '13 at 9:20











        • Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

          – Br. Sayan
          Jun 13 '17 at 11:40














        6












        6








        6







        First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system.



        sudo apt-get install openssh-server


        If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.






        share|improve this answer















        First make sure that ssh service running on 192.168.1.7 or not..it is possible that system doesn't have an SSH daemon, so you need to install ssh on that system.



        sudo apt-get install openssh-server


        If it's already installed, run sudo service ssh restart, then comment here with the output of this command from both the systems.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 13 '13 at 11:03









        Nathan J. Brauer

        87021129




        87021129










        answered Feb 13 '13 at 8:24









        P4cK3tHuNt3RP4cK3tHuNt3R

        1612




        1612













        • When I restart the ssh it stops first and starts with a PID no.

          – Rudra
          Feb 13 '13 at 9:20











        • Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

          – Br. Sayan
          Jun 13 '17 at 11:40



















        • When I restart the ssh it stops first and starts with a PID no.

          – Rudra
          Feb 13 '13 at 9:20











        • Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

          – Br. Sayan
          Jun 13 '17 at 11:40

















        When I restart the ssh it stops first and starts with a PID no.

        – Rudra
        Feb 13 '13 at 9:20





        When I restart the ssh it stops first and starts with a PID no.

        – Rudra
        Feb 13 '13 at 9:20













        Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

        – Br. Sayan
        Jun 13 '17 at 11:40





        Thank you this seems to be precisely the case for me... openssh-server had to be installed on the target machine.

        – Br. Sayan
        Jun 13 '17 at 11:40











        0














        In my installation of Ubuntu 14.04 LTS desktop edition from the Ubuntu website, openssh-server is not installed by default. BIG FAT THUMBS DOWN Canonical!!!!! The installation is relatively easy and has been mentioned already by other answers above:



        sudo apt-get update && sudo apt-get upgrade && sudo apt-get install openssh-server






        share|improve this answer



















        • 1





          Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

          – ps95
          May 9 '15 at 7:43
















        0














        In my installation of Ubuntu 14.04 LTS desktop edition from the Ubuntu website, openssh-server is not installed by default. BIG FAT THUMBS DOWN Canonical!!!!! The installation is relatively easy and has been mentioned already by other answers above:



        sudo apt-get update && sudo apt-get upgrade && sudo apt-get install openssh-server






        share|improve this answer



















        • 1





          Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

          – ps95
          May 9 '15 at 7:43














        0












        0








        0







        In my installation of Ubuntu 14.04 LTS desktop edition from the Ubuntu website, openssh-server is not installed by default. BIG FAT THUMBS DOWN Canonical!!!!! The installation is relatively easy and has been mentioned already by other answers above:



        sudo apt-get update && sudo apt-get upgrade && sudo apt-get install openssh-server






        share|improve this answer













        In my installation of Ubuntu 14.04 LTS desktop edition from the Ubuntu website, openssh-server is not installed by default. BIG FAT THUMBS DOWN Canonical!!!!! The installation is relatively easy and has been mentioned already by other answers above:



        sudo apt-get update && sudo apt-get upgrade && sudo apt-get install openssh-server







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 3 '14 at 20:48









        MishaPMishaP

        1012




        1012








        • 1





          Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

          – ps95
          May 9 '15 at 7:43














        • 1





          Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

          – ps95
          May 9 '15 at 7:43








        1




        1





        Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

        – ps95
        May 9 '15 at 7:43





        Many people don't use ssh. I think it's alright to not include the server by default on the desktop edition.

        – ps95
        May 9 '15 at 7:43











        0














        Check to make sure your router either, can accept ssh or has it enabled somewhere in the settings. Sometimes something this simple can be overlooked.






        share|improve this answer




























          0














          Check to make sure your router either, can accept ssh or has it enabled somewhere in the settings. Sometimes something this simple can be overlooked.






          share|improve this answer


























            0












            0








            0







            Check to make sure your router either, can accept ssh or has it enabled somewhere in the settings. Sometimes something this simple can be overlooked.






            share|improve this answer













            Check to make sure your router either, can accept ssh or has it enabled somewhere in the settings. Sometimes something this simple can be overlooked.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 30 '15 at 4:51









            BudsBuds

            1




            1























                0















                1. Goto vim /etc/ssh/sshd_config



                2. Change the Authentication "PermitRootLogin" to "yes"



                  Eg:



                  Authentication:

                  PermitRootLogin yes


                3. service sshd restart







                share|improve this answer






























                  0















                  1. Goto vim /etc/ssh/sshd_config



                  2. Change the Authentication "PermitRootLogin" to "yes"



                    Eg:



                    Authentication:

                    PermitRootLogin yes


                  3. service sshd restart







                  share|improve this answer




























                    0












                    0








                    0








                    1. Goto vim /etc/ssh/sshd_config



                    2. Change the Authentication "PermitRootLogin" to "yes"



                      Eg:



                      Authentication:

                      PermitRootLogin yes


                    3. service sshd restart







                    share|improve this answer
















                    1. Goto vim /etc/ssh/sshd_config



                    2. Change the Authentication "PermitRootLogin" to "yes"



                      Eg:



                      Authentication:

                      PermitRootLogin yes


                    3. service sshd restart








                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Mar 17 '16 at 13:15









                    Mostafa Ahangarha

                    2,62652243




                    2,62652243










                    answered Mar 17 '16 at 12:01









                    suryalegend89suryalegend89

                    1




                    1























                        0














                        Check if you have SSH server installed:



                        dpkg -l openssh-server


                        If not, install it:



                        sudo apt update && sudo apt install -y ssh


                        Now check if your 22 port is in use:



                        netstat -atn | grep :22





                        share|improve this answer




























                          0














                          Check if you have SSH server installed:



                          dpkg -l openssh-server


                          If not, install it:



                          sudo apt update && sudo apt install -y ssh


                          Now check if your 22 port is in use:



                          netstat -atn | grep :22





                          share|improve this answer


























                            0












                            0








                            0







                            Check if you have SSH server installed:



                            dpkg -l openssh-server


                            If not, install it:



                            sudo apt update && sudo apt install -y ssh


                            Now check if your 22 port is in use:



                            netstat -atn | grep :22





                            share|improve this answer













                            Check if you have SSH server installed:



                            dpkg -l openssh-server


                            If not, install it:



                            sudo apt update && sudo apt install -y ssh


                            Now check if your 22 port is in use:



                            netstat -atn | grep :22






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 20 at 21:27









                            blkpwsblkpws

                            663611




                            663611

















                                protected by Zanna Jan 21 at 9:01



                                Thank you for your interest in this question.
                                Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                Would you like to answer one of these unanswered questions instead?



                                Popular posts from this blog

                                flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                                Mangá

                                 ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕