ssh: Could not resolve hostname server: Name or service not known












6















I'm trying to test my honeypot but for some reason I'm getting this message:



ssh root@server 10.0.2.15
ssh: Could not resolve hostname server: Name or service not known


What I'm doing wrong?










share|improve this question




















  • 1





    Add what command did you use for ssh.

    – Rahul
    Jan 21 '17 at 23:47






  • 3





    the correct syntax for ssh would be this ssh root@10.0.2.15

    – WooJoo
    Jan 22 '17 at 0:36











  • @WooJoo Looks like you have the answer ;)

    – Seth
    Jan 22 '17 at 4:52











  • @WooJoo yes, that's the right answer , I can't believe I made such a simple mistake

    – ebatinstitute
    Jan 22 '17 at 8:18











  • @WooJoo Post the answer ;)

    – pa4080
    Jan 22 '17 at 8:26
















6















I'm trying to test my honeypot but for some reason I'm getting this message:



ssh root@server 10.0.2.15
ssh: Could not resolve hostname server: Name or service not known


What I'm doing wrong?










share|improve this question




















  • 1





    Add what command did you use for ssh.

    – Rahul
    Jan 21 '17 at 23:47






  • 3





    the correct syntax for ssh would be this ssh root@10.0.2.15

    – WooJoo
    Jan 22 '17 at 0:36











  • @WooJoo Looks like you have the answer ;)

    – Seth
    Jan 22 '17 at 4:52











  • @WooJoo yes, that's the right answer , I can't believe I made such a simple mistake

    – ebatinstitute
    Jan 22 '17 at 8:18











  • @WooJoo Post the answer ;)

    – pa4080
    Jan 22 '17 at 8:26














6












6








6


1






I'm trying to test my honeypot but for some reason I'm getting this message:



ssh root@server 10.0.2.15
ssh: Could not resolve hostname server: Name or service not known


What I'm doing wrong?










share|improve this question
















I'm trying to test my honeypot but for some reason I'm getting this message:



ssh root@server 10.0.2.15
ssh: Could not resolve hostname server: Name or service not known


What I'm doing wrong?







ssh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 22 '17 at 8:22









pa4080

14.4k52670




14.4k52670










asked Jan 21 '17 at 23:30









ebatinstituteebatinstitute

76239




76239








  • 1





    Add what command did you use for ssh.

    – Rahul
    Jan 21 '17 at 23:47






  • 3





    the correct syntax for ssh would be this ssh root@10.0.2.15

    – WooJoo
    Jan 22 '17 at 0:36











  • @WooJoo Looks like you have the answer ;)

    – Seth
    Jan 22 '17 at 4:52











  • @WooJoo yes, that's the right answer , I can't believe I made such a simple mistake

    – ebatinstitute
    Jan 22 '17 at 8:18











  • @WooJoo Post the answer ;)

    – pa4080
    Jan 22 '17 at 8:26














  • 1





    Add what command did you use for ssh.

    – Rahul
    Jan 21 '17 at 23:47






  • 3





    the correct syntax for ssh would be this ssh root@10.0.2.15

    – WooJoo
    Jan 22 '17 at 0:36











  • @WooJoo Looks like you have the answer ;)

    – Seth
    Jan 22 '17 at 4:52











  • @WooJoo yes, that's the right answer , I can't believe I made such a simple mistake

    – ebatinstitute
    Jan 22 '17 at 8:18











  • @WooJoo Post the answer ;)

    – pa4080
    Jan 22 '17 at 8:26








1




1





Add what command did you use for ssh.

– Rahul
Jan 21 '17 at 23:47





Add what command did you use for ssh.

– Rahul
Jan 21 '17 at 23:47




3




3





the correct syntax for ssh would be this ssh root@10.0.2.15

– WooJoo
Jan 22 '17 at 0:36





the correct syntax for ssh would be this ssh root@10.0.2.15

– WooJoo
Jan 22 '17 at 0:36













@WooJoo Looks like you have the answer ;)

– Seth
Jan 22 '17 at 4:52





@WooJoo Looks like you have the answer ;)

– Seth
Jan 22 '17 at 4:52













@WooJoo yes, that's the right answer , I can't believe I made such a simple mistake

– ebatinstitute
Jan 22 '17 at 8:18





@WooJoo yes, that's the right answer , I can't believe I made such a simple mistake

– ebatinstitute
Jan 22 '17 at 8:18













@WooJoo Post the answer ;)

– pa4080
Jan 22 '17 at 8:26





@WooJoo Post the answer ;)

– pa4080
Jan 22 '17 at 8:26










3 Answers
3






active

oldest

votes


















4














To connect to an ssh server in a terminal you need:




  1. The call ssh to start the program

  2. The user name, which in your case is root

  3. An @ sign separating the user name from the server identification

  4. The IP address or name of the server, which in your case is 10.0.2.15


Assembled, the command looks like:



ssh root@10.0.2.15


in general terms, ssh user@server.



Alternatively, you can use the -l option to directly specify the login name and skip the @ syntax:



ssh 10.0.2.15 -l root





share|improve this answer

































    5














    As WooJoo stated, you need to tell it a valid server to connect to. If you wanted to use the form $ ssh root@server you can, but you would need to have server as an entry in /etc/hosts or your dns server (which is not the case or you would not have had an error), or an entry in a file called config located typically at /home/username/.ssh/config.



    A sample /etc/hosts entry would look like:



    # Sample /etc/hosts file
    127.0.0.1 localhost
    127.0.1.1 computerhostnamehere

    10.0.2.15 server


    and a sample /home/username/.ssh/config could be as simple as:



    Host server
    HostName 10.0.2.15
    User root


    This would get you the basic functionality you are looking for. There are many more options available for placing in the ~/.ssh/config file.



    See man ssh for more options :)






    share|improve this answer































      0














      Please try by adding server entry to which you are trying to ssh in /etc/hosts file of machine from where you want to do ssh






      share|improve this answer























        Your Answer








        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "89"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f874724%2fssh-could-not-resolve-hostname-server-name-or-service-not-known%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        4














        To connect to an ssh server in a terminal you need:




        1. The call ssh to start the program

        2. The user name, which in your case is root

        3. An @ sign separating the user name from the server identification

        4. The IP address or name of the server, which in your case is 10.0.2.15


        Assembled, the command looks like:



        ssh root@10.0.2.15


        in general terms, ssh user@server.



        Alternatively, you can use the -l option to directly specify the login name and skip the @ syntax:



        ssh 10.0.2.15 -l root





        share|improve this answer






























          4














          To connect to an ssh server in a terminal you need:




          1. The call ssh to start the program

          2. The user name, which in your case is root

          3. An @ sign separating the user name from the server identification

          4. The IP address or name of the server, which in your case is 10.0.2.15


          Assembled, the command looks like:



          ssh root@10.0.2.15


          in general terms, ssh user@server.



          Alternatively, you can use the -l option to directly specify the login name and skip the @ syntax:



          ssh 10.0.2.15 -l root





          share|improve this answer




























            4












            4








            4







            To connect to an ssh server in a terminal you need:




            1. The call ssh to start the program

            2. The user name, which in your case is root

            3. An @ sign separating the user name from the server identification

            4. The IP address or name of the server, which in your case is 10.0.2.15


            Assembled, the command looks like:



            ssh root@10.0.2.15


            in general terms, ssh user@server.



            Alternatively, you can use the -l option to directly specify the login name and skip the @ syntax:



            ssh 10.0.2.15 -l root





            share|improve this answer















            To connect to an ssh server in a terminal you need:




            1. The call ssh to start the program

            2. The user name, which in your case is root

            3. An @ sign separating the user name from the server identification

            4. The IP address or name of the server, which in your case is 10.0.2.15


            Assembled, the command looks like:



            ssh root@10.0.2.15


            in general terms, ssh user@server.



            Alternatively, you can use the -l option to directly specify the login name and skip the @ syntax:



            ssh 10.0.2.15 -l root






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 9 '18 at 18:30









            guntbert

            9,311133170




            9,311133170










            answered Jan 22 '17 at 12:27









            WooJooWooJoo

            1378




            1378

























                5














                As WooJoo stated, you need to tell it a valid server to connect to. If you wanted to use the form $ ssh root@server you can, but you would need to have server as an entry in /etc/hosts or your dns server (which is not the case or you would not have had an error), or an entry in a file called config located typically at /home/username/.ssh/config.



                A sample /etc/hosts entry would look like:



                # Sample /etc/hosts file
                127.0.0.1 localhost
                127.0.1.1 computerhostnamehere

                10.0.2.15 server


                and a sample /home/username/.ssh/config could be as simple as:



                Host server
                HostName 10.0.2.15
                User root


                This would get you the basic functionality you are looking for. There are many more options available for placing in the ~/.ssh/config file.



                See man ssh for more options :)






                share|improve this answer




























                  5














                  As WooJoo stated, you need to tell it a valid server to connect to. If you wanted to use the form $ ssh root@server you can, but you would need to have server as an entry in /etc/hosts or your dns server (which is not the case or you would not have had an error), or an entry in a file called config located typically at /home/username/.ssh/config.



                  A sample /etc/hosts entry would look like:



                  # Sample /etc/hosts file
                  127.0.0.1 localhost
                  127.0.1.1 computerhostnamehere

                  10.0.2.15 server


                  and a sample /home/username/.ssh/config could be as simple as:



                  Host server
                  HostName 10.0.2.15
                  User root


                  This would get you the basic functionality you are looking for. There are many more options available for placing in the ~/.ssh/config file.



                  See man ssh for more options :)






                  share|improve this answer


























                    5












                    5








                    5







                    As WooJoo stated, you need to tell it a valid server to connect to. If you wanted to use the form $ ssh root@server you can, but you would need to have server as an entry in /etc/hosts or your dns server (which is not the case or you would not have had an error), or an entry in a file called config located typically at /home/username/.ssh/config.



                    A sample /etc/hosts entry would look like:



                    # Sample /etc/hosts file
                    127.0.0.1 localhost
                    127.0.1.1 computerhostnamehere

                    10.0.2.15 server


                    and a sample /home/username/.ssh/config could be as simple as:



                    Host server
                    HostName 10.0.2.15
                    User root


                    This would get you the basic functionality you are looking for. There are many more options available for placing in the ~/.ssh/config file.



                    See man ssh for more options :)






                    share|improve this answer













                    As WooJoo stated, you need to tell it a valid server to connect to. If you wanted to use the form $ ssh root@server you can, but you would need to have server as an entry in /etc/hosts or your dns server (which is not the case or you would not have had an error), or an entry in a file called config located typically at /home/username/.ssh/config.



                    A sample /etc/hosts entry would look like:



                    # Sample /etc/hosts file
                    127.0.0.1 localhost
                    127.0.1.1 computerhostnamehere

                    10.0.2.15 server


                    and a sample /home/username/.ssh/config could be as simple as:



                    Host server
                    HostName 10.0.2.15
                    User root


                    This would get you the basic functionality you are looking for. There are many more options available for placing in the ~/.ssh/config file.



                    See man ssh for more options :)







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jun 13 '17 at 21:04









                    ben-Nabiy Derushben-Nabiy Derush

                    496214




                    496214























                        0














                        Please try by adding server entry to which you are trying to ssh in /etc/hosts file of machine from where you want to do ssh






                        share|improve this answer




























                          0














                          Please try by adding server entry to which you are trying to ssh in /etc/hosts file of machine from where you want to do ssh






                          share|improve this answer


























                            0












                            0








                            0







                            Please try by adding server entry to which you are trying to ssh in /etc/hosts file of machine from where you want to do ssh






                            share|improve this answer













                            Please try by adding server entry to which you are trying to ssh in /etc/hosts file of machine from where you want to do ssh







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Feb 8 at 10:24









                            patke pravinpatke pravin

                            1




                            1






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f874724%2fssh-could-not-resolve-hostname-server-name-or-service-not-known%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                How to make a Squid Proxy server?

                                Is this a new Fibonacci Identity?

                                19世紀