0

my question is here while am copying the files from one server to another server using the scp command. while am running in putty it was asking for password of two sever machines.Is there any other way to copy the files without password or with passwords means how can i pass in command.

Regards, Sindhu.

2

By far the best way is to use public/private key pair authentication. If you don't already have a key pair on the machine from which you are running putty you should create one using puttygen, save the private key locally and provide the path to it in putty at Connection/SSH/Auth, then save the public key in the ~/.ssh/authorized_keys file of the machine to which you are connecting with putty. Then you need to save the public key of this machine (probably at ~/.ssh/id_rsa.pub) in the ~/.ssh/authorized_keys file of the user & machine to which it connects to run scp.

16
  • Thanks for quick response, and am not having rsa to use so can use please suggest more, I used the same script to copy the file from one server to another server but that time it is not asking for password but where as am trying to copy to different server it is asking for password... example: am working in server 1 i need to copy the files to server 2 and server 3 .. for server2 it not asking for password where as for server it is asking for passsword.
    – sindhu
    Nov 25 '15 at 7:01
  • if you are not using some other security mechanism, any machine should ask for a password when you connect with scp, if it doesn't then its security is seriously lacking.
    – gogoud
    Nov 25 '15 at 7:05
  • can you suggest how to write the command to pass the password in putty
    – sindhu
    Nov 25 '15 at 7:12
  • to do this 'properly' you use another piece of software by the same guy called pageant - available at chiark.greenend.org.uk/~sgtatham/putty/download.html. But also see superuser.com/questions/44106/….
    – gogoud
    Nov 25 '15 at 7:14
  • ok Thank you :) so in shell script we can't pass the password right ...
    – sindhu
    Nov 25 '15 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.