Transfer files using scp: permission denied












11















I try to transfer files from remote computer using ssh to my computer :



scp My_file.txt user_id@server:/Home


This should put My_file.txt in the home folder on my own computer, right?
I get



scp/Home: permission denied


Also when I try: ...@server:/Desktop, in order to copy the files from the remote computer to my desktop.



What am I doing wrong?










share|improve this question

























  • If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder.

    – Manula Waidyanatha
    Sep 12 '12 at 9:42
















11















I try to transfer files from remote computer using ssh to my computer :



scp My_file.txt user_id@server:/Home


This should put My_file.txt in the home folder on my own computer, right?
I get



scp/Home: permission denied


Also when I try: ...@server:/Desktop, in order to copy the files from the remote computer to my desktop.



What am I doing wrong?










share|improve this question

























  • If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder.

    – Manula Waidyanatha
    Sep 12 '12 at 9:42














11












11








11








I try to transfer files from remote computer using ssh to my computer :



scp My_file.txt user_id@server:/Home


This should put My_file.txt in the home folder on my own computer, right?
I get



scp/Home: permission denied


Also when I try: ...@server:/Desktop, in order to copy the files from the remote computer to my desktop.



What am I doing wrong?










share|improve this question
















I try to transfer files from remote computer using ssh to my computer :



scp My_file.txt user_id@server:/Home


This should put My_file.txt in the home folder on my own computer, right?
I get



scp/Home: permission denied


Also when I try: ...@server:/Desktop, in order to copy the files from the remote computer to my desktop.



What am I doing wrong?







ssh permissions scp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 12 '12 at 17:57









jasonwryan

50.2k14134189




50.2k14134189










asked Sep 12 '12 at 9:09









ErezErez

58114




58114













  • If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder.

    – Manula Waidyanatha
    Sep 12 '12 at 9:42



















  • If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder.

    – Manula Waidyanatha
    Sep 12 '12 at 9:42

















If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder.

– Manula Waidyanatha
Sep 12 '12 at 9:42





If you want to copy the file to the home folder of 'user_id' use scp My_file.txt user_id@server: It copies to the users home folder.

– Manula Waidyanatha
Sep 12 '12 at 9:42










11 Answers
11






active

oldest

votes


















22














Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:



scp My_file.txt user_id@server:/home/erez/


You can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect:



scp My_file.txt user_id@server:~/


You can even leave out the path altogether on the remote side; this means your home directory.



scp My_file.txt user_id@server:


That is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/:



scp My_file.txt user_id@server:/home/erez/Desktop/


or using the shortcut:



scp My_file.txt user_id@server:~/Desktop/


or using a relative path on the remote side, which is interpreted relative to your home directory:



scp My_file.txt user_id@server:Desktop/




Edit:



As @ckhan already mentioned, you also have to swap the arguments, it has to be



scp FROM TO


So if you want to copy the file My_file.txt from the server user_id@server to your desktop you should try the following:



scp user_id@server:/path/to/My_file.txt ~/Desktop/


If the file My_file.txt is located in your home directory on the server you may again use the shortcut:



scp user_id@server:~/My_file.txt ~/Desktop/





share|improve this answer


























  • - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

    – Erez
    Sep 12 '12 at 9:31













  • On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

    – daniel Azuelos
    Mar 19 '15 at 12:21








  • 1





    In order to thank you, i registered to the website. Thanks you saved my day:)

    – Ad Infinitum
    Jan 17 '17 at 22:12



















3














I came here for "Transfer files using scp: permission denied" because I had the same error.



In my case, the file downloaded with scp would have overwritten a file owned by root, and I wasn't root. In short, check the ownership of the file being overwritten.






share|improve this answer



















  • 1





    In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

    – Shadur
    Oct 9 '12 at 9:25



















2














this seems to be like permissioning issue



The file might not have read permissions as it is delivered to the destination server as the source account.



you need to ensure the file at the source has required permissions especially read permission



-rw-r--r--



chmod 744



then scp the file to destination. This will be resolved






share|improve this answer



















  • 2





    -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

    – G-Man
    Dec 10 '15 at 0:11



















2














What fixed the "permission denied" for me was, on the remote server, change the folder ownership to root: (This can happen when you are sending a file to a non-root user, and the directory is owned by root!)
On the remote machine (copying dest.):



sudo chown (your username) (remote folder)


Also to be sure, enable all permissions on the remote folder: (Not always necessary):



sudo chmod 777 (remote folder)





share|improve this answer































    1














    You have the arguments to scp reversed. It's source first, then destination, like cp.
    man scp for more details.






    share|improve this answer































      1














      Permisssion Denied means you are not the root of the server. You just hold an account there. So in that case you need to do this:



      sudo scp -r /path2yourFolder/ username@server_Ip:/home/username


      This will copy to your home directory on server.



      This will also work:



      scp -r /path2yourFolder/ username@server_Ip:~/





      share|improve this answer

































        0














        Install a windows tool "mRemoteG" from www.mremoteng.org/



        Create your SSH connection to the desired box.



        Click on the "Transfer File" menu.



        It will allow to transfer file easily from Windows to Linux.



        thanks.






        share|improve this answer































          0














          Amazon Linux AMI



          Be sure that you need to set absolute server path, from home in current case:



          scp file.txt SSH-ALIAS:/home/YOUR_USER/





          share|improve this answer































            0














            The same permissions apply on both sides of the scp. You will get this error if the user lacks permission to write to the destination. The symptoms appear to implicate the source, however in my case the destination was created by root and lacked write permission for the intended user account.






            share|improve this answer































              0














              In my case, I also tried to grant all the permission with -R to the folder but still got the error about permission.



              I had to remove "/" before the path of the target server and folder. The reason is because Downloads is the first folder I can list out after I ssh to the server, for example: ssh tiennsloit@13.76.91.2



              This works:



              sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:Downloads



              This was not working:



              sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:/Downloads






              share|improve this answer








              New contributor




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




























                -3














                before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"






                share|improve this answer


























                • you can copy file that are not 777

                  – Archemar
                  Mar 19 '15 at 10:49











                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "106"
                };
                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: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                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%2funix.stackexchange.com%2fquestions%2f47909%2ftransfer-files-using-scp-permission-denied%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                11 Answers
                11






                active

                oldest

                votes








                11 Answers
                11






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                22














                Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:



                scp My_file.txt user_id@server:/home/erez/


                You can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect:



                scp My_file.txt user_id@server:~/


                You can even leave out the path altogether on the remote side; this means your home directory.



                scp My_file.txt user_id@server:


                That is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/:



                scp My_file.txt user_id@server:/home/erez/Desktop/


                or using the shortcut:



                scp My_file.txt user_id@server:~/Desktop/


                or using a relative path on the remote side, which is interpreted relative to your home directory:



                scp My_file.txt user_id@server:Desktop/




                Edit:



                As @ckhan already mentioned, you also have to swap the arguments, it has to be



                scp FROM TO


                So if you want to copy the file My_file.txt from the server user_id@server to your desktop you should try the following:



                scp user_id@server:/path/to/My_file.txt ~/Desktop/


                If the file My_file.txt is located in your home directory on the server you may again use the shortcut:



                scp user_id@server:~/My_file.txt ~/Desktop/





                share|improve this answer


























                • - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

                  – Erez
                  Sep 12 '12 at 9:31













                • On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

                  – daniel Azuelos
                  Mar 19 '15 at 12:21








                • 1





                  In order to thank you, i registered to the website. Thanks you saved my day:)

                  – Ad Infinitum
                  Jan 17 '17 at 22:12
















                22














                Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:



                scp My_file.txt user_id@server:/home/erez/


                You can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect:



                scp My_file.txt user_id@server:~/


                You can even leave out the path altogether on the remote side; this means your home directory.



                scp My_file.txt user_id@server:


                That is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/:



                scp My_file.txt user_id@server:/home/erez/Desktop/


                or using the shortcut:



                scp My_file.txt user_id@server:~/Desktop/


                or using a relative path on the remote side, which is interpreted relative to your home directory:



                scp My_file.txt user_id@server:Desktop/




                Edit:



                As @ckhan already mentioned, you also have to swap the arguments, it has to be



                scp FROM TO


                So if you want to copy the file My_file.txt from the server user_id@server to your desktop you should try the following:



                scp user_id@server:/path/to/My_file.txt ~/Desktop/


                If the file My_file.txt is located in your home directory on the server you may again use the shortcut:



                scp user_id@server:~/My_file.txt ~/Desktop/





                share|improve this answer


























                • - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

                  – Erez
                  Sep 12 '12 at 9:31













                • On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

                  – daniel Azuelos
                  Mar 19 '15 at 12:21








                • 1





                  In order to thank you, i registered to the website. Thanks you saved my day:)

                  – Ad Infinitum
                  Jan 17 '17 at 22:12














                22












                22








                22







                Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:



                scp My_file.txt user_id@server:/home/erez/


                You can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect:



                scp My_file.txt user_id@server:~/


                You can even leave out the path altogether on the remote side; this means your home directory.



                scp My_file.txt user_id@server:


                That is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/:



                scp My_file.txt user_id@server:/home/erez/Desktop/


                or using the shortcut:



                scp My_file.txt user_id@server:~/Desktop/


                or using a relative path on the remote side, which is interpreted relative to your home directory:



                scp My_file.txt user_id@server:Desktop/




                Edit:



                As @ckhan already mentioned, you also have to swap the arguments, it has to be



                scp FROM TO


                So if you want to copy the file My_file.txt from the server user_id@server to your desktop you should try the following:



                scp user_id@server:/path/to/My_file.txt ~/Desktop/


                If the file My_file.txt is located in your home directory on the server you may again use the shortcut:



                scp user_id@server:~/My_file.txt ~/Desktop/





                share|improve this answer















                Your commands are trying to put the new Document to the root (/) of your machine. What you want to do is to transfer them to your home directory (since you have no permissions to write to /). If path to your home is something like /home/erez try the following:



                scp My_file.txt user_id@server:/home/erez/


                You can substitute the path to your home directory with the shortcut ~/, so the following will have the same effect:



                scp My_file.txt user_id@server:~/


                You can even leave out the path altogether on the remote side; this means your home directory.



                scp My_file.txt user_id@server:


                That is, to copy the file to your desktop you might want to transfer it to /home/erez/Desktop/:



                scp My_file.txt user_id@server:/home/erez/Desktop/


                or using the shortcut:



                scp My_file.txt user_id@server:~/Desktop/


                or using a relative path on the remote side, which is interpreted relative to your home directory:



                scp My_file.txt user_id@server:Desktop/




                Edit:



                As @ckhan already mentioned, you also have to swap the arguments, it has to be



                scp FROM TO


                So if you want to copy the file My_file.txt from the server user_id@server to your desktop you should try the following:



                scp user_id@server:/path/to/My_file.txt ~/Desktop/


                If the file My_file.txt is located in your home directory on the server you may again use the shortcut:



                scp user_id@server:~/My_file.txt ~/Desktop/






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Sep 12 '12 at 22:30









                Gilles

                539k12810921606




                539k12810921606










                answered Sep 12 '12 at 9:23









                binfalsebinfalse

                3,45311727




                3,45311727













                • - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

                  – Erez
                  Sep 12 '12 at 9:31













                • On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

                  – daniel Azuelos
                  Mar 19 '15 at 12:21








                • 1





                  In order to thank you, i registered to the website. Thanks you saved my day:)

                  – Ad Infinitum
                  Jan 17 '17 at 22:12



















                • - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

                  – Erez
                  Sep 12 '12 at 9:31













                • On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

                  – daniel Azuelos
                  Mar 19 '15 at 12:21








                • 1





                  In order to thank you, i registered to the website. Thanks you saved my day:)

                  – Ad Infinitum
                  Jan 17 '17 at 22:12

















                - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

                – Erez
                Sep 12 '12 at 9:31







                - I've tried: "~/" for 'Home' now, and also "~/Desktop/. Both resulted in : My_file.txt 100% 0 0.0 KB/s 00:00, and I cannot see the files in my folders. What am I still doing wrong ? Thanks a lot!

                – Erez
                Sep 12 '12 at 9:31















                On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

                – daniel Azuelos
                Mar 19 '15 at 12:21







                On your second command example, the ~ should be protected from evaluation so as to be evaluated on the remote host: ~ for example.

                – daniel Azuelos
                Mar 19 '15 at 12:21






                1




                1





                In order to thank you, i registered to the website. Thanks you saved my day:)

                – Ad Infinitum
                Jan 17 '17 at 22:12





                In order to thank you, i registered to the website. Thanks you saved my day:)

                – Ad Infinitum
                Jan 17 '17 at 22:12













                3














                I came here for "Transfer files using scp: permission denied" because I had the same error.



                In my case, the file downloaded with scp would have overwritten a file owned by root, and I wasn't root. In short, check the ownership of the file being overwritten.






                share|improve this answer



















                • 1





                  In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

                  – Shadur
                  Oct 9 '12 at 9:25
















                3














                I came here for "Transfer files using scp: permission denied" because I had the same error.



                In my case, the file downloaded with scp would have overwritten a file owned by root, and I wasn't root. In short, check the ownership of the file being overwritten.






                share|improve this answer



















                • 1





                  In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

                  – Shadur
                  Oct 9 '12 at 9:25














                3












                3








                3







                I came here for "Transfer files using scp: permission denied" because I had the same error.



                In my case, the file downloaded with scp would have overwritten a file owned by root, and I wasn't root. In short, check the ownership of the file being overwritten.






                share|improve this answer













                I came here for "Transfer files using scp: permission denied" because I had the same error.



                In my case, the file downloaded with scp would have overwritten a file owned by root, and I wasn't root. In short, check the ownership of the file being overwritten.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 9 '12 at 8:20









                PJ BrunetPJ Brunet

                287210




                287210








                • 1





                  In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

                  – Shadur
                  Oct 9 '12 at 9:25














                • 1





                  In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

                  – Shadur
                  Oct 9 '12 at 9:25








                1




                1





                In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

                – Shadur
                Oct 9 '12 at 9:25





                In this case it's because he's trying to write to /Home and not being root, he doesn't have write access outside ~/

                – Shadur
                Oct 9 '12 at 9:25











                2














                this seems to be like permissioning issue



                The file might not have read permissions as it is delivered to the destination server as the source account.



                you need to ensure the file at the source has required permissions especially read permission



                -rw-r--r--



                chmod 744



                then scp the file to destination. This will be resolved






                share|improve this answer



















                • 2





                  -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

                  – G-Man
                  Dec 10 '15 at 0:11
















                2














                this seems to be like permissioning issue



                The file might not have read permissions as it is delivered to the destination server as the source account.



                you need to ensure the file at the source has required permissions especially read permission



                -rw-r--r--



                chmod 744



                then scp the file to destination. This will be resolved






                share|improve this answer



















                • 2





                  -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

                  – G-Man
                  Dec 10 '15 at 0:11














                2












                2








                2







                this seems to be like permissioning issue



                The file might not have read permissions as it is delivered to the destination server as the source account.



                you need to ensure the file at the source has required permissions especially read permission



                -rw-r--r--



                chmod 744



                then scp the file to destination. This will be resolved






                share|improve this answer













                this seems to be like permissioning issue



                The file might not have read permissions as it is delivered to the destination server as the source account.



                you need to ensure the file at the source has required permissions especially read permission



                -rw-r--r--



                chmod 744



                then scp the file to destination. This will be resolved







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 9 '15 at 23:28









                TabbuTabbu

                211




                211








                • 2





                  -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

                  – G-Man
                  Dec 10 '15 at 0:11














                • 2





                  -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

                  – G-Man
                  Dec 10 '15 at 0:11








                2




                2





                -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

                – G-Man
                Dec 10 '15 at 0:11





                -rw-r--r-- is 644, not 744.  Setting executable permission on a file that is not actually executable can cause problems.

                – G-Man
                Dec 10 '15 at 0:11











                2














                What fixed the "permission denied" for me was, on the remote server, change the folder ownership to root: (This can happen when you are sending a file to a non-root user, and the directory is owned by root!)
                On the remote machine (copying dest.):



                sudo chown (your username) (remote folder)


                Also to be sure, enable all permissions on the remote folder: (Not always necessary):



                sudo chmod 777 (remote folder)





                share|improve this answer




























                  2














                  What fixed the "permission denied" for me was, on the remote server, change the folder ownership to root: (This can happen when you are sending a file to a non-root user, and the directory is owned by root!)
                  On the remote machine (copying dest.):



                  sudo chown (your username) (remote folder)


                  Also to be sure, enable all permissions on the remote folder: (Not always necessary):



                  sudo chmod 777 (remote folder)





                  share|improve this answer


























                    2












                    2








                    2







                    What fixed the "permission denied" for me was, on the remote server, change the folder ownership to root: (This can happen when you are sending a file to a non-root user, and the directory is owned by root!)
                    On the remote machine (copying dest.):



                    sudo chown (your username) (remote folder)


                    Also to be sure, enable all permissions on the remote folder: (Not always necessary):



                    sudo chmod 777 (remote folder)





                    share|improve this answer













                    What fixed the "permission denied" for me was, on the remote server, change the folder ownership to root: (This can happen when you are sending a file to a non-root user, and the directory is owned by root!)
                    On the remote machine (copying dest.):



                    sudo chown (your username) (remote folder)


                    Also to be sure, enable all permissions on the remote folder: (Not always necessary):



                    sudo chmod 777 (remote folder)






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 24 '17 at 18:48









                    Stan TatarnykovStan Tatarnykov

                    1211




                    1211























                        1














                        You have the arguments to scp reversed. It's source first, then destination, like cp.
                        man scp for more details.






                        share|improve this answer




























                          1














                          You have the arguments to scp reversed. It's source first, then destination, like cp.
                          man scp for more details.






                          share|improve this answer


























                            1












                            1








                            1







                            You have the arguments to scp reversed. It's source first, then destination, like cp.
                            man scp for more details.






                            share|improve this answer













                            You have the arguments to scp reversed. It's source first, then destination, like cp.
                            man scp for more details.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Sep 12 '12 at 9:23









                            ckhanckhan

                            3,5681318




                            3,5681318























                                1














                                Permisssion Denied means you are not the root of the server. You just hold an account there. So in that case you need to do this:



                                sudo scp -r /path2yourFolder/ username@server_Ip:/home/username


                                This will copy to your home directory on server.



                                This will also work:



                                scp -r /path2yourFolder/ username@server_Ip:~/





                                share|improve this answer






























                                  1














                                  Permisssion Denied means you are not the root of the server. You just hold an account there. So in that case you need to do this:



                                  sudo scp -r /path2yourFolder/ username@server_Ip:/home/username


                                  This will copy to your home directory on server.



                                  This will also work:



                                  scp -r /path2yourFolder/ username@server_Ip:~/





                                  share|improve this answer




























                                    1












                                    1








                                    1







                                    Permisssion Denied means you are not the root of the server. You just hold an account there. So in that case you need to do this:



                                    sudo scp -r /path2yourFolder/ username@server_Ip:/home/username


                                    This will copy to your home directory on server.



                                    This will also work:



                                    scp -r /path2yourFolder/ username@server_Ip:~/





                                    share|improve this answer















                                    Permisssion Denied means you are not the root of the server. You just hold an account there. So in that case you need to do this:



                                    sudo scp -r /path2yourFolder/ username@server_Ip:/home/username


                                    This will copy to your home directory on server.



                                    This will also work:



                                    scp -r /path2yourFolder/ username@server_Ip:~/






                                    share|improve this answer














                                    share|improve this answer



                                    share|improve this answer








                                    edited May 28 '14 at 17:10









                                    drs

                                    3,31862861




                                    3,31862861










                                    answered May 28 '14 at 16:28









                                    Abhishek KaushikAbhishek Kaushik

                                    1112




                                    1112























                                        0














                                        Install a windows tool "mRemoteG" from www.mremoteng.org/



                                        Create your SSH connection to the desired box.



                                        Click on the "Transfer File" menu.



                                        It will allow to transfer file easily from Windows to Linux.



                                        thanks.






                                        share|improve this answer




























                                          0














                                          Install a windows tool "mRemoteG" from www.mremoteng.org/



                                          Create your SSH connection to the desired box.



                                          Click on the "Transfer File" menu.



                                          It will allow to transfer file easily from Windows to Linux.



                                          thanks.






                                          share|improve this answer


























                                            0












                                            0








                                            0







                                            Install a windows tool "mRemoteG" from www.mremoteng.org/



                                            Create your SSH connection to the desired box.



                                            Click on the "Transfer File" menu.



                                            It will allow to transfer file easily from Windows to Linux.



                                            thanks.






                                            share|improve this answer













                                            Install a windows tool "mRemoteG" from www.mremoteng.org/



                                            Create your SSH connection to the desired box.



                                            Click on the "Transfer File" menu.



                                            It will allow to transfer file easily from Windows to Linux.



                                            thanks.







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Mar 7 '16 at 3:25









                                            General SoftwaresGeneral Softwares

                                            1




                                            1























                                                0














                                                Amazon Linux AMI



                                                Be sure that you need to set absolute server path, from home in current case:



                                                scp file.txt SSH-ALIAS:/home/YOUR_USER/





                                                share|improve this answer




























                                                  0














                                                  Amazon Linux AMI



                                                  Be sure that you need to set absolute server path, from home in current case:



                                                  scp file.txt SSH-ALIAS:/home/YOUR_USER/





                                                  share|improve this answer


























                                                    0












                                                    0








                                                    0







                                                    Amazon Linux AMI



                                                    Be sure that you need to set absolute server path, from home in current case:



                                                    scp file.txt SSH-ALIAS:/home/YOUR_USER/





                                                    share|improve this answer













                                                    Amazon Linux AMI



                                                    Be sure that you need to set absolute server path, from home in current case:



                                                    scp file.txt SSH-ALIAS:/home/YOUR_USER/






                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered Nov 11 '16 at 20:30









                                                    dimpiaxdimpiax

                                                    1012




                                                    1012























                                                        0














                                                        The same permissions apply on both sides of the scp. You will get this error if the user lacks permission to write to the destination. The symptoms appear to implicate the source, however in my case the destination was created by root and lacked write permission for the intended user account.






                                                        share|improve this answer




























                                                          0














                                                          The same permissions apply on both sides of the scp. You will get this error if the user lacks permission to write to the destination. The symptoms appear to implicate the source, however in my case the destination was created by root and lacked write permission for the intended user account.






                                                          share|improve this answer


























                                                            0












                                                            0








                                                            0







                                                            The same permissions apply on both sides of the scp. You will get this error if the user lacks permission to write to the destination. The symptoms appear to implicate the source, however in my case the destination was created by root and lacked write permission for the intended user account.






                                                            share|improve this answer













                                                            The same permissions apply on both sides of the scp. You will get this error if the user lacks permission to write to the destination. The symptoms appear to implicate the source, however in my case the destination was created by root and lacked write permission for the intended user account.







                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered Jan 2 at 6:22









                                                            jinzaijinzai

                                                            1011




                                                            1011























                                                                0














                                                                In my case, I also tried to grant all the permission with -R to the folder but still got the error about permission.



                                                                I had to remove "/" before the path of the target server and folder. The reason is because Downloads is the first folder I can list out after I ssh to the server, for example: ssh tiennsloit@13.76.91.2



                                                                This works:



                                                                sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:Downloads



                                                                This was not working:



                                                                sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:/Downloads






                                                                share|improve this answer








                                                                New contributor




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

























                                                                  0














                                                                  In my case, I also tried to grant all the permission with -R to the folder but still got the error about permission.



                                                                  I had to remove "/" before the path of the target server and folder. The reason is because Downloads is the first folder I can list out after I ssh to the server, for example: ssh tiennsloit@13.76.91.2



                                                                  This works:



                                                                  sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:Downloads



                                                                  This was not working:



                                                                  sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:/Downloads






                                                                  share|improve this answer








                                                                  New contributor




                                                                  tiennsloit 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







                                                                    In my case, I also tried to grant all the permission with -R to the folder but still got the error about permission.



                                                                    I had to remove "/" before the path of the target server and folder. The reason is because Downloads is the first folder I can list out after I ssh to the server, for example: ssh tiennsloit@13.76.91.2



                                                                    This works:



                                                                    sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:Downloads



                                                                    This was not working:



                                                                    sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:/Downloads






                                                                    share|improve this answer








                                                                    New contributor




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










                                                                    In my case, I also tried to grant all the permission with -R to the folder but still got the error about permission.



                                                                    I had to remove "/" before the path of the target server and folder. The reason is because Downloads is the first folder I can list out after I ssh to the server, for example: ssh tiennsloit@13.76.91.2



                                                                    This works:



                                                                    sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:Downloads



                                                                    This was not working:



                                                                    sudo scp -rp /Users/macintosh.vn/Downloads/bbhs_20190301.zip tiennsloit@13.76.91.2:/Downloads







                                                                    share|improve this answer








                                                                    New contributor




                                                                    tiennsloit 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




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









                                                                    answered 21 mins ago









                                                                    tiennsloittiennsloit

                                                                    1




                                                                    1




                                                                    New contributor




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





                                                                    New contributor





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






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























                                                                        -3














                                                                        before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"






                                                                        share|improve this answer


























                                                                        • you can copy file that are not 777

                                                                          – Archemar
                                                                          Mar 19 '15 at 10:49
















                                                                        -3














                                                                        before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"






                                                                        share|improve this answer


























                                                                        • you can copy file that are not 777

                                                                          – Archemar
                                                                          Mar 19 '15 at 10:49














                                                                        -3












                                                                        -3








                                                                        -3







                                                                        before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"






                                                                        share|improve this answer















                                                                        before using scp command, make sure that you give permissions read, write and execute to everyone outside. "chmod 777 file_name"







                                                                        share|improve this answer














                                                                        share|improve this answer



                                                                        share|improve this answer








                                                                        edited Mar 19 '15 at 11:29









                                                                        Anthon

                                                                        60.9k17104166




                                                                        60.9k17104166










                                                                        answered Mar 19 '15 at 9:01









                                                                        tysontyson

                                                                        12




                                                                        12













                                                                        • you can copy file that are not 777

                                                                          – Archemar
                                                                          Mar 19 '15 at 10:49



















                                                                        • you can copy file that are not 777

                                                                          – Archemar
                                                                          Mar 19 '15 at 10:49

















                                                                        you can copy file that are not 777

                                                                        – Archemar
                                                                        Mar 19 '15 at 10:49





                                                                        you can copy file that are not 777

                                                                        – Archemar
                                                                        Mar 19 '15 at 10:49


















                                                                        draft saved

                                                                        draft discarded




















































                                                                        Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                                                        • 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%2funix.stackexchange.com%2fquestions%2f47909%2ftransfer-files-using-scp-permission-denied%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

                                                                        CARDNET

                                                                        Boot-repair Failure: Unable to locate package grub-common:i386

                                                                        濃尾地震