ssh scp command copies files from remote to remote but not to local machineTrouble connecting to a local machine through a remote serverSSH: Access local file (redirect local file contents) via remote SSH consoleTrying to SCP from Local Mac to Amazon AWS Linux Machinessh login successful, but scp password gives me “Permission denied”Force SFTP/SCP to copy files with a remote directory's permissionShell script from local machine to execute command in remote machine, then continue on the local machinessh forced command: sftp/scp onlyCopy file from remote SSH to local without SSH client on remotePermission denied when using scp, but able to sshDelete remote dir and transfer replacement dir from local

What is the word for reserving something for yourself before others do?

Why is consensus so controversial in Britain?

Do I have a twin with permutated remainders?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Is there a hemisphere-neutral way of specifying a season?

Why are electrically insulating heatsinks so rare? Is it just cost?

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

How can saying a song's name be a copyright violation?

Why do I get two different answers for this counting problem?

What killed these X2 caps?

What does it mean to describe someone as a butt steak?

Blender 2.8 I can't see vertices, edges or faces in edit mode

What is going on with Captain Marvel's blood colour?

Neighboring nodes in the network

Python: return float 1.0 as int 1 but float 1.5 as float 1.5

90's TV series where a boy goes to another dimension through portal near power lines

AES: Why is it a good practice to use only the first 16bytes of a hash for encryption?

How much of data wrangling is a data scientist's job?

Brothers & sisters

Facing a paradox: Earnshaw's theorem in one dimension

Etiquette around loan refinance - decision is going to cost first broker a lot of money

Diode datasheet reading

Reserved de-dupe rules

Should I tell management that I intend to leave due to bad software development practices?



ssh scp command copies files from remote to remote but not to local machine


Trouble connecting to a local machine through a remote serverSSH: Access local file (redirect local file contents) via remote SSH consoleTrying to SCP from Local Mac to Amazon AWS Linux Machinessh login successful, but scp password gives me “Permission denied”Force SFTP/SCP to copy files with a remote directory's permissionShell script from local machine to execute command in remote machine, then continue on the local machinessh forced command: sftp/scp onlyCopy file from remote SSH to local without SSH client on remotePermission denied when using scp, but able to sshDelete remote dir and transfer replacement dir from local






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I need help with this one please. I couldn't connect with any FTP client to a remote server given by a client. It would be SFTP protocol, but I could never connect.



With ssh user@login.microsites.companyname.com I'm able to connect.
After connecting I can use ls to list the directories and I get prod dev stage which refers to the three sudomains.



If I go inside prod I get www tmp log.



My task would be to copy the remote www directory to my local machine. However I'm not able to.



My idea was after ssh connection to scp user@login.microsites.companyname.com:/prod/www /Desktop which should copy the files to my local Desktop.



However what it does is copying the files to the remote machine creating a directory "Desktop" which has the copied files.










share|improve this question




























    1















    I need help with this one please. I couldn't connect with any FTP client to a remote server given by a client. It would be SFTP protocol, but I could never connect.



    With ssh user@login.microsites.companyname.com I'm able to connect.
    After connecting I can use ls to list the directories and I get prod dev stage which refers to the three sudomains.



    If I go inside prod I get www tmp log.



    My task would be to copy the remote www directory to my local machine. However I'm not able to.



    My idea was after ssh connection to scp user@login.microsites.companyname.com:/prod/www /Desktop which should copy the files to my local Desktop.



    However what it does is copying the files to the remote machine creating a directory "Desktop" which has the copied files.










    share|improve this question
























      1












      1








      1








      I need help with this one please. I couldn't connect with any FTP client to a remote server given by a client. It would be SFTP protocol, but I could never connect.



      With ssh user@login.microsites.companyname.com I'm able to connect.
      After connecting I can use ls to list the directories and I get prod dev stage which refers to the three sudomains.



      If I go inside prod I get www tmp log.



      My task would be to copy the remote www directory to my local machine. However I'm not able to.



      My idea was after ssh connection to scp user@login.microsites.companyname.com:/prod/www /Desktop which should copy the files to my local Desktop.



      However what it does is copying the files to the remote machine creating a directory "Desktop" which has the copied files.










      share|improve this question














      I need help with this one please. I couldn't connect with any FTP client to a remote server given by a client. It would be SFTP protocol, but I could never connect.



      With ssh user@login.microsites.companyname.com I'm able to connect.
      After connecting I can use ls to list the directories and I get prod dev stage which refers to the three sudomains.



      If I go inside prod I get www tmp log.



      My task would be to copy the remote www directory to my local machine. However I'm not able to.



      My idea was after ssh connection to scp user@login.microsites.companyname.com:/prod/www /Desktop which should copy the files to my local Desktop.



      However what it does is copying the files to the remote machine creating a directory "Desktop" which has the copied files.







      ssh scp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      MattMatt

      11516




      11516




















          2 Answers
          2






          active

          oldest

          votes


















          0














          You seem to have gotten things muddled up. You are already on your remote server, so the /Desktop refers to /Desktop on the remote server, not your local machine, essentially you're taking a long way round there and copying the file locally to a different path on the server. Instead, you either need to change the command or change where you are running it from.



          Option 1. From the server after sshing in:



          scp -r /path/to/your/folder user@yourlocalmachine:/Desktop


          Option 2. From your local machine (easier)



          scp -r user@login.microsites.companyname.com:/prod/www /Desktop





          share|improve this answer

























          • Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

            – Matt
            yesterday











          • Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

            – Solarflare
            yesterday











          • Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

            – Matt
            yesterday












          • Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

            – Solarflare
            yesterday











          • thanks so muchthat did it for me

            – Matt
            yesterday


















          0














          Your need to run your scp command on your computer, not the remote one. Or you have to qualify the destination Desktop with the appropriate user name and address.






          share|improve this answer








          New contributor




          loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            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%2fserverfault.com%2fquestions%2f961056%2fssh-scp-command-copies-files-from-remote-to-remote-but-not-to-local-machine%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You seem to have gotten things muddled up. You are already on your remote server, so the /Desktop refers to /Desktop on the remote server, not your local machine, essentially you're taking a long way round there and copying the file locally to a different path on the server. Instead, you either need to change the command or change where you are running it from.



            Option 1. From the server after sshing in:



            scp -r /path/to/your/folder user@yourlocalmachine:/Desktop


            Option 2. From your local machine (easier)



            scp -r user@login.microsites.companyname.com:/prod/www /Desktop





            share|improve this answer

























            • Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

              – Matt
              yesterday











            • Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

              – Solarflare
              yesterday











            • Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

              – Matt
              yesterday












            • Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

              – Solarflare
              yesterday











            • thanks so muchthat did it for me

              – Matt
              yesterday















            0














            You seem to have gotten things muddled up. You are already on your remote server, so the /Desktop refers to /Desktop on the remote server, not your local machine, essentially you're taking a long way round there and copying the file locally to a different path on the server. Instead, you either need to change the command or change where you are running it from.



            Option 1. From the server after sshing in:



            scp -r /path/to/your/folder user@yourlocalmachine:/Desktop


            Option 2. From your local machine (easier)



            scp -r user@login.microsites.companyname.com:/prod/www /Desktop





            share|improve this answer

























            • Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

              – Matt
              yesterday











            • Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

              – Solarflare
              yesterday











            • Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

              – Matt
              yesterday












            • Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

              – Solarflare
              yesterday











            • thanks so muchthat did it for me

              – Matt
              yesterday













            0












            0








            0







            You seem to have gotten things muddled up. You are already on your remote server, so the /Desktop refers to /Desktop on the remote server, not your local machine, essentially you're taking a long way round there and copying the file locally to a different path on the server. Instead, you either need to change the command or change where you are running it from.



            Option 1. From the server after sshing in:



            scp -r /path/to/your/folder user@yourlocalmachine:/Desktop


            Option 2. From your local machine (easier)



            scp -r user@login.microsites.companyname.com:/prod/www /Desktop





            share|improve this answer















            You seem to have gotten things muddled up. You are already on your remote server, so the /Desktop refers to /Desktop on the remote server, not your local machine, essentially you're taking a long way round there and copying the file locally to a different path on the server. Instead, you either need to change the command or change where you are running it from.



            Option 1. From the server after sshing in:



            scp -r /path/to/your/folder user@yourlocalmachine:/Desktop


            Option 2. From your local machine (easier)



            scp -r user@login.microsites.companyname.com:/prod/www /Desktop






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited yesterday

























            answered 2 days ago









            SolarflareSolarflare

            363




            363












            • Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

              – Matt
              yesterday











            • Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

              – Solarflare
              yesterday











            • Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

              – Matt
              yesterday












            • Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

              – Solarflare
              yesterday











            • thanks so muchthat did it for me

              – Matt
              yesterday

















            • Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

              – Matt
              yesterday











            • Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

              – Solarflare
              yesterday











            • Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

              – Matt
              yesterday












            • Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

              – Solarflare
              yesterday











            • thanks so muchthat did it for me

              – Matt
              yesterday
















            Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

            – Matt
            yesterday





            Hey, thanks. If I use option 2 though … it asks me for the password, when entering I get scp: /prod/www: No such file or directory

            – Matt
            yesterday













            Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

            – Solarflare
            yesterday





            Ah yes, sorry I hadn't realised you wanted the whole folder. You'd need to use -r (Recursively copy entire directories). I've updated my answer to add this in.

            – Solarflare
            yesterday













            Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

            – Matt
            yesterday






            Thanks, I already tried that, but no luck either: See imgur.com/FGyiXGr Maybe this has todo with the fact that I couldn't connect with sftp either?

            – Matt
            yesterday














            Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

            – Solarflare
            yesterday





            Is there actually a /prod/www directory? You need to put the full path from root, so if prod is actually under /var/ for example, then you would need to change it to /var/prod/www. Go to the folder and run pwd to make sure you have the full path to the folder and you're not missing anything.

            – Solarflare
            yesterday













            thanks so muchthat did it for me

            – Matt
            yesterday





            thanks so muchthat did it for me

            – Matt
            yesterday













            0














            Your need to run your scp command on your computer, not the remote one. Or you have to qualify the destination Desktop with the appropriate user name and address.






            share|improve this answer








            New contributor




            loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
























              0














              Your need to run your scp command on your computer, not the remote one. Or you have to qualify the destination Desktop with the appropriate user name and address.






              share|improve this answer








              New contributor




              loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                0












                0








                0







                Your need to run your scp command on your computer, not the remote one. Or you have to qualify the destination Desktop with the appropriate user name and address.






                share|improve this answer








                New contributor




                loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                Your need to run your scp command on your computer, not the remote one. Or you have to qualify the destination Desktop with the appropriate user name and address.







                share|improve this answer








                New contributor




                loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered 2 days ago









                lorisloris

                12




                12




                New contributor




                loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                loris is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Server Fault!


                    • 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%2fserverfault.com%2fquestions%2f961056%2fssh-scp-command-copies-files-from-remote-to-remote-but-not-to-local-machine%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 write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                    What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                    Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?