Need to copy a file from unix box to windows folder using pscp command











up vote
4
down vote

favorite
1












I have a unix svr A:



username: uname
password: pwd


then there are some files under /usr/local/jboss/configuration which are accessible only when a 'sudo su' command is performed. (and the username changes to root@svrname ,also no password prompted for this command)



Now, I am trying to execute the below command which is trying to copy the file available under /usr/local/jboss/configuration to my local machine.



pscp -pw pwd root@svrname:/usr/local/jboss/configuration/xyz.xml C:Usersdownloads


but this command prompts for password, m clueless. Please help!!










share|improve this question
















bumped to the homepage by Community 2 days ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.



















    up vote
    4
    down vote

    favorite
    1












    I have a unix svr A:



    username: uname
    password: pwd


    then there are some files under /usr/local/jboss/configuration which are accessible only when a 'sudo su' command is performed. (and the username changes to root@svrname ,also no password prompted for this command)



    Now, I am trying to execute the below command which is trying to copy the file available under /usr/local/jboss/configuration to my local machine.



    pscp -pw pwd root@svrname:/usr/local/jboss/configuration/xyz.xml C:Usersdownloads


    but this command prompts for password, m clueless. Please help!!










    share|improve this question
















    bumped to the homepage by Community 2 days ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      up vote
      4
      down vote

      favorite
      1









      up vote
      4
      down vote

      favorite
      1






      1





      I have a unix svr A:



      username: uname
      password: pwd


      then there are some files under /usr/local/jboss/configuration which are accessible only when a 'sudo su' command is performed. (and the username changes to root@svrname ,also no password prompted for this command)



      Now, I am trying to execute the below command which is trying to copy the file available under /usr/local/jboss/configuration to my local machine.



      pscp -pw pwd root@svrname:/usr/local/jboss/configuration/xyz.xml C:Usersdownloads


      but this command prompts for password, m clueless. Please help!!










      share|improve this question















      I have a unix svr A:



      username: uname
      password: pwd


      then there are some files under /usr/local/jboss/configuration which are accessible only when a 'sudo su' command is performed. (and the username changes to root@svrname ,also no password prompted for this command)



      Now, I am trying to execute the below command which is trying to copy the file available under /usr/local/jboss/configuration to my local machine.



      pscp -pw pwd root@svrname:/usr/local/jboss/configuration/xyz.xml C:Usersdownloads


      but this command prompts for password, m clueless. Please help!!







      unix putty






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 24 '12 at 16:43









      grawity

      227k35475537




      227k35475537










      asked Aug 24 '12 at 16:24









      suraj

      2112




      2112





      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 days ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          0
          down vote













          how did you set the variable pwd (should be $pwd)? does it have special characters? check that carefully and echo $pwd to make sure that it has your exact password.



          then take a look a look at your auth or secure log on the server to see what error you are getting. it should tell you if your password is accepted or not.



          also, make sure your root user can log into remotely (not a good idea, but if the server is only accessible in your internal network then it is fine).






          share|improve this answer





















          • the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
            – suraj
            Aug 27 '12 at 9:34


















          up vote
          0
          down vote













          It's likely that your ssh server is configured to disallow remote root logins. Check your /etc/ssh/sshd_config on the server.






          share|improve this answer




























            up vote
            0
            down vote













            how about coying the files some place where "uname" can access them



            uname@svrname:~$ sudo cp -r /usr/local/jboss/ ~/
            uname@svrname:~$ sudo chown -R uname ~/jboss/


            and then on your windows machine:



            pscp -pw pwd uname@svrname:~/jboss/configuration/xyz.xml C:Usersdownloads





            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',
              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%2f465925%2fneed-to-copy-a-file-from-unix-box-to-windows-folder-using-pscp-command%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              how did you set the variable pwd (should be $pwd)? does it have special characters? check that carefully and echo $pwd to make sure that it has your exact password.



              then take a look a look at your auth or secure log on the server to see what error you are getting. it should tell you if your password is accepted or not.



              also, make sure your root user can log into remotely (not a good idea, but if the server is only accessible in your internal network then it is fine).






              share|improve this answer





















              • the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
                – suraj
                Aug 27 '12 at 9:34















              up vote
              0
              down vote













              how did you set the variable pwd (should be $pwd)? does it have special characters? check that carefully and echo $pwd to make sure that it has your exact password.



              then take a look a look at your auth or secure log on the server to see what error you are getting. it should tell you if your password is accepted or not.



              also, make sure your root user can log into remotely (not a good idea, but if the server is only accessible in your internal network then it is fine).






              share|improve this answer





















              • the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
                – suraj
                Aug 27 '12 at 9:34













              up vote
              0
              down vote










              up vote
              0
              down vote









              how did you set the variable pwd (should be $pwd)? does it have special characters? check that carefully and echo $pwd to make sure that it has your exact password.



              then take a look a look at your auth or secure log on the server to see what error you are getting. it should tell you if your password is accepted or not.



              also, make sure your root user can log into remotely (not a good idea, but if the server is only accessible in your internal network then it is fine).






              share|improve this answer












              how did you set the variable pwd (should be $pwd)? does it have special characters? check that carefully and echo $pwd to make sure that it has your exact password.



              then take a look a look at your auth or secure log on the server to see what error you are getting. it should tell you if your password is accepted or not.



              also, make sure your root user can log into remotely (not a good idea, but if the server is only accessible in your internal network then it is fine).







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Aug 24 '12 at 16:46









              johnshen64

              4,2491211




              4,2491211












              • the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
                – suraj
                Aug 27 '12 at 9:34


















              • the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
                – suraj
                Aug 27 '12 at 9:34
















              the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
              – suraj
              Aug 27 '12 at 9:34




              the pwd isn't a variable, sorry if this confused you. the password to login to the svr is 'pwd' that's what I meant here
              – suraj
              Aug 27 '12 at 9:34












              up vote
              0
              down vote













              It's likely that your ssh server is configured to disallow remote root logins. Check your /etc/ssh/sshd_config on the server.






              share|improve this answer

























                up vote
                0
                down vote













                It's likely that your ssh server is configured to disallow remote root logins. Check your /etc/ssh/sshd_config on the server.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  It's likely that your ssh server is configured to disallow remote root logins. Check your /etc/ssh/sshd_config on the server.






                  share|improve this answer












                  It's likely that your ssh server is configured to disallow remote root logins. Check your /etc/ssh/sshd_config on the server.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 1 '17 at 1:00









                  Charles Burge

                  1,5661311




                  1,5661311






















                      up vote
                      0
                      down vote













                      how about coying the files some place where "uname" can access them



                      uname@svrname:~$ sudo cp -r /usr/local/jboss/ ~/
                      uname@svrname:~$ sudo chown -R uname ~/jboss/


                      and then on your windows machine:



                      pscp -pw pwd uname@svrname:~/jboss/configuration/xyz.xml C:Usersdownloads





                      share|improve this answer

























                        up vote
                        0
                        down vote













                        how about coying the files some place where "uname" can access them



                        uname@svrname:~$ sudo cp -r /usr/local/jboss/ ~/
                        uname@svrname:~$ sudo chown -R uname ~/jboss/


                        and then on your windows machine:



                        pscp -pw pwd uname@svrname:~/jboss/configuration/xyz.xml C:Usersdownloads





                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          how about coying the files some place where "uname" can access them



                          uname@svrname:~$ sudo cp -r /usr/local/jboss/ ~/
                          uname@svrname:~$ sudo chown -R uname ~/jboss/


                          and then on your windows machine:



                          pscp -pw pwd uname@svrname:~/jboss/configuration/xyz.xml C:Usersdownloads





                          share|improve this answer












                          how about coying the files some place where "uname" can access them



                          uname@svrname:~$ sudo cp -r /usr/local/jboss/ ~/
                          uname@svrname:~$ sudo chown -R uname ~/jboss/


                          and then on your windows machine:



                          pscp -pw pwd uname@svrname:~/jboss/configuration/xyz.xml C:Usersdownloads






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Apr 1 '17 at 17:15









                          Raouf M. Bencheraiet

                          1045




                          1045






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f465925%2fneed-to-copy-a-file-from-unix-box-to-windows-folder-using-pscp-command%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

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

                              Mangá

                              Eduardo VII do Reino Unido