Sending file from Linux to Windows with SCP Comand












2















I know there are already some threads about this, but none of them helped me to solve my problem.
I want to send a simple text file from my Linux machine to my windows 10 PC using the scp command.
So this is what I type in my Linux console:



scp -P80  test.txt mywindowsusername@mywindowsip:/Desktop


I use port 80 because otherwise the system tells me port 22 is closed.



After a while I get the error:



ssh_exchange_identification: Connection closed by remote host 


lost connection



I also tried a lot of different commands like copying the file to a different folder and using



-r


after the port but the error is always the same.



Does somebody has an idea how to fix this?










share|improve this question















migrated from security.stackexchange.com Jan 17 at 0:13


This question came from our site for information security professionals.














  • 3





    Do you have an ssh or scp server running on windows? Regardless, this has nothing to do with security.

    – AndrolGenhald
    Jan 16 at 22:41











  • It's true this question belongs on SuperUser or Linux/Unix but that said: sounds like firewall rules. Check both computers that they will allow send/recieve on port 22 and try again. Make sure there is an SSH server set up on the Windows machine (there are tutorials online). You can also use the graphical based WinSCP which always worked for me.

    – bashCypher
    Jan 16 at 22:54
















2















I know there are already some threads about this, but none of them helped me to solve my problem.
I want to send a simple text file from my Linux machine to my windows 10 PC using the scp command.
So this is what I type in my Linux console:



scp -P80  test.txt mywindowsusername@mywindowsip:/Desktop


I use port 80 because otherwise the system tells me port 22 is closed.



After a while I get the error:



ssh_exchange_identification: Connection closed by remote host 


lost connection



I also tried a lot of different commands like copying the file to a different folder and using



-r


after the port but the error is always the same.



Does somebody has an idea how to fix this?










share|improve this question















migrated from security.stackexchange.com Jan 17 at 0:13


This question came from our site for information security professionals.














  • 3





    Do you have an ssh or scp server running on windows? Regardless, this has nothing to do with security.

    – AndrolGenhald
    Jan 16 at 22:41











  • It's true this question belongs on SuperUser or Linux/Unix but that said: sounds like firewall rules. Check both computers that they will allow send/recieve on port 22 and try again. Make sure there is an SSH server set up on the Windows machine (there are tutorials online). You can also use the graphical based WinSCP which always worked for me.

    – bashCypher
    Jan 16 at 22:54














2












2








2








I know there are already some threads about this, but none of them helped me to solve my problem.
I want to send a simple text file from my Linux machine to my windows 10 PC using the scp command.
So this is what I type in my Linux console:



scp -P80  test.txt mywindowsusername@mywindowsip:/Desktop


I use port 80 because otherwise the system tells me port 22 is closed.



After a while I get the error:



ssh_exchange_identification: Connection closed by remote host 


lost connection



I also tried a lot of different commands like copying the file to a different folder and using



-r


after the port but the error is always the same.



Does somebody has an idea how to fix this?










share|improve this question
















I know there are already some threads about this, but none of them helped me to solve my problem.
I want to send a simple text file from my Linux machine to my windows 10 PC using the scp command.
So this is what I type in my Linux console:



scp -P80  test.txt mywindowsusername@mywindowsip:/Desktop


I use port 80 because otherwise the system tells me port 22 is closed.



After a while I get the error:



ssh_exchange_identification: Connection closed by remote host 


lost connection



I also tried a lot of different commands like copying the file to a different folder and using



-r


after the port but the error is always the same.



Does somebody has an idea how to fix this?







ssh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 23 at 13:53









Binarus

37517




37517










asked Jan 16 at 22:39









gammagamma

141




141




migrated from security.stackexchange.com Jan 17 at 0:13


This question came from our site for information security professionals.









migrated from security.stackexchange.com Jan 17 at 0:13


This question came from our site for information security professionals.










  • 3





    Do you have an ssh or scp server running on windows? Regardless, this has nothing to do with security.

    – AndrolGenhald
    Jan 16 at 22:41











  • It's true this question belongs on SuperUser or Linux/Unix but that said: sounds like firewall rules. Check both computers that they will allow send/recieve on port 22 and try again. Make sure there is an SSH server set up on the Windows machine (there are tutorials online). You can also use the graphical based WinSCP which always worked for me.

    – bashCypher
    Jan 16 at 22:54














  • 3





    Do you have an ssh or scp server running on windows? Regardless, this has nothing to do with security.

    – AndrolGenhald
    Jan 16 at 22:41











  • It's true this question belongs on SuperUser or Linux/Unix but that said: sounds like firewall rules. Check both computers that they will allow send/recieve on port 22 and try again. Make sure there is an SSH server set up on the Windows machine (there are tutorials online). You can also use the graphical based WinSCP which always worked for me.

    – bashCypher
    Jan 16 at 22:54








3




3





Do you have an ssh or scp server running on windows? Regardless, this has nothing to do with security.

– AndrolGenhald
Jan 16 at 22:41





Do you have an ssh or scp server running on windows? Regardless, this has nothing to do with security.

– AndrolGenhald
Jan 16 at 22:41













It's true this question belongs on SuperUser or Linux/Unix but that said: sounds like firewall rules. Check both computers that they will allow send/recieve on port 22 and try again. Make sure there is an SSH server set up on the Windows machine (there are tutorials online). You can also use the graphical based WinSCP which always worked for me.

– bashCypher
Jan 16 at 22:54





It's true this question belongs on SuperUser or Linux/Unix but that said: sounds like firewall rules. Check both computers that they will allow send/recieve on port 22 and try again. Make sure there is an SSH server set up on the Windows machine (there are tutorials online). You can also use the graphical based WinSCP which always worked for me.

– bashCypher
Jan 16 at 22:54










1 Answer
1






active

oldest

votes


















0














You have said that the system would tell you that port 22 is closed. But obviously, your system does not tell you that port 80 is closed. That would mean that on the Windows PC you have running a piece of software which listens on port 80, but not on port 22 (this could be a web server then), or that the firewall on the Windows PC is configured to let pass through inbound traffic on port 80, but not on port 22.



An "scp server" is usually incorporated into an SSH server (at least, I never have heard of somebody actually using a standalone SCP-only server). This means that you probably have to install an SSH server on your Windows PC. Please note that Windows does not incorporate such a server (perhaps unless you are using Microsoft's Unix subsystem which they ship with the new Windows versions, but I don't know).



When having installed the SSH server on your Windows PC, please be aware that it will listen on port 22 by default. If you want it to listen on port 80, you will have to change its configuration. The exact configuration method and steps depend on the server software, of course.



If I were you, I would do the following:



1) Check out why port 80 is open on your Windows machine (check for installed software which might run unintentionally, check the firewall settings). If port 80 is open by accident, close it.



2) Install the SSH server on your Windows machine.



3) Configure the firewall on your Windows machine to let in TCP connections on port 22, possibly restricted to certain hosts (your Linux machine), and possibly allowed to certain programs only (the SSH server).



It should work then.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    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%2fsuperuser.com%2fquestions%2f1395168%2fsending-file-from-linux-to-windows-with-scp-comand%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You have said that the system would tell you that port 22 is closed. But obviously, your system does not tell you that port 80 is closed. That would mean that on the Windows PC you have running a piece of software which listens on port 80, but not on port 22 (this could be a web server then), or that the firewall on the Windows PC is configured to let pass through inbound traffic on port 80, but not on port 22.



    An "scp server" is usually incorporated into an SSH server (at least, I never have heard of somebody actually using a standalone SCP-only server). This means that you probably have to install an SSH server on your Windows PC. Please note that Windows does not incorporate such a server (perhaps unless you are using Microsoft's Unix subsystem which they ship with the new Windows versions, but I don't know).



    When having installed the SSH server on your Windows PC, please be aware that it will listen on port 22 by default. If you want it to listen on port 80, you will have to change its configuration. The exact configuration method and steps depend on the server software, of course.



    If I were you, I would do the following:



    1) Check out why port 80 is open on your Windows machine (check for installed software which might run unintentionally, check the firewall settings). If port 80 is open by accident, close it.



    2) Install the SSH server on your Windows machine.



    3) Configure the firewall on your Windows machine to let in TCP connections on port 22, possibly restricted to certain hosts (your Linux machine), and possibly allowed to certain programs only (the SSH server).



    It should work then.






    share|improve this answer




























      0














      You have said that the system would tell you that port 22 is closed. But obviously, your system does not tell you that port 80 is closed. That would mean that on the Windows PC you have running a piece of software which listens on port 80, but not on port 22 (this could be a web server then), or that the firewall on the Windows PC is configured to let pass through inbound traffic on port 80, but not on port 22.



      An "scp server" is usually incorporated into an SSH server (at least, I never have heard of somebody actually using a standalone SCP-only server). This means that you probably have to install an SSH server on your Windows PC. Please note that Windows does not incorporate such a server (perhaps unless you are using Microsoft's Unix subsystem which they ship with the new Windows versions, but I don't know).



      When having installed the SSH server on your Windows PC, please be aware that it will listen on port 22 by default. If you want it to listen on port 80, you will have to change its configuration. The exact configuration method and steps depend on the server software, of course.



      If I were you, I would do the following:



      1) Check out why port 80 is open on your Windows machine (check for installed software which might run unintentionally, check the firewall settings). If port 80 is open by accident, close it.



      2) Install the SSH server on your Windows machine.



      3) Configure the firewall on your Windows machine to let in TCP connections on port 22, possibly restricted to certain hosts (your Linux machine), and possibly allowed to certain programs only (the SSH server).



      It should work then.






      share|improve this answer


























        0












        0








        0







        You have said that the system would tell you that port 22 is closed. But obviously, your system does not tell you that port 80 is closed. That would mean that on the Windows PC you have running a piece of software which listens on port 80, but not on port 22 (this could be a web server then), or that the firewall on the Windows PC is configured to let pass through inbound traffic on port 80, but not on port 22.



        An "scp server" is usually incorporated into an SSH server (at least, I never have heard of somebody actually using a standalone SCP-only server). This means that you probably have to install an SSH server on your Windows PC. Please note that Windows does not incorporate such a server (perhaps unless you are using Microsoft's Unix subsystem which they ship with the new Windows versions, but I don't know).



        When having installed the SSH server on your Windows PC, please be aware that it will listen on port 22 by default. If you want it to listen on port 80, you will have to change its configuration. The exact configuration method and steps depend on the server software, of course.



        If I were you, I would do the following:



        1) Check out why port 80 is open on your Windows machine (check for installed software which might run unintentionally, check the firewall settings). If port 80 is open by accident, close it.



        2) Install the SSH server on your Windows machine.



        3) Configure the firewall on your Windows machine to let in TCP connections on port 22, possibly restricted to certain hosts (your Linux machine), and possibly allowed to certain programs only (the SSH server).



        It should work then.






        share|improve this answer













        You have said that the system would tell you that port 22 is closed. But obviously, your system does not tell you that port 80 is closed. That would mean that on the Windows PC you have running a piece of software which listens on port 80, but not on port 22 (this could be a web server then), or that the firewall on the Windows PC is configured to let pass through inbound traffic on port 80, but not on port 22.



        An "scp server" is usually incorporated into an SSH server (at least, I never have heard of somebody actually using a standalone SCP-only server). This means that you probably have to install an SSH server on your Windows PC. Please note that Windows does not incorporate such a server (perhaps unless you are using Microsoft's Unix subsystem which they ship with the new Windows versions, but I don't know).



        When having installed the SSH server on your Windows PC, please be aware that it will listen on port 22 by default. If you want it to listen on port 80, you will have to change its configuration. The exact configuration method and steps depend on the server software, of course.



        If I were you, I would do the following:



        1) Check out why port 80 is open on your Windows machine (check for installed software which might run unintentionally, check the firewall settings). If port 80 is open by accident, close it.



        2) Install the SSH server on your Windows machine.



        3) Configure the firewall on your Windows machine to let in TCP connections on port 22, possibly restricted to certain hosts (your Linux machine), and possibly allowed to certain programs only (the SSH server).



        It should work then.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 23 at 13:59









        BinarusBinarus

        37517




        37517






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • 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%2fsuperuser.com%2fquestions%2f1395168%2fsending-file-from-linux-to-windows-with-scp-comand%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 reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?