Transfer Files to another host without password prompt

14,468

Looking at the link it seemed to be opposite to what I normally would do. Read this link : http://wp.uberdose.com/2006/10/16/ssh-automatic-login/ about setting it up. Using ssh-copy-id makes things easier.

It can be done with 2 commands from the client machine :

ssh-keygen -t dsa
ssh-copy-id -i id_dsa user@remotehost
Share:
14,468

Related videos on Youtube

London
Author by

London

Updated on September 18, 2022

Comments

  • London
    London over 1 year

    Hello I've tried both scp and rsync to copy resource from my machine to remote host.

    I don't have a root access on a remote machine but I need to transfer big amount of files from my host to remote machine all located in different directories and doing this manually would just take really long time(it will take long time anyway).

    This is what I've tried so far :

    echo "password" | rsync -v -e myfile ssh user@remotehost:/home/user/destination
    

    Or :

    echo "password" | scp -r myfile user@remotehost:/home/user/destination 
    

    Or:

    scp -r myfile user@remotehost:/home/user/destination  <<EOF
    password
    EOF
    

    But I still get that annoying prompt for password :

    user@remotehost's password:
    

    Any other suggestions that I try ?

    Update

    My user on the local machine is not same as the one on the remote machine(the one on the remote machine doesn't exist on my machine).

  • Admin
    Admin over 12 years
    do I need a root access for this on the remote machine?
  • Admin
    Admin over 12 years
    No...If you have an id with which you can login to the box then you can do the steps mentioned in the link
  • Admin
    Admin over 12 years
    so I guess my machine is client and the machine I'm copying to is a server?
  • Admin
    Admin over 12 years
    I've tried and it's not working, please see my update
  • Admin
    Admin over 12 years
    If you want to transfer file from Box A to Box B then generate the key in Box A and then add the key to the authorised_keys file in Box B. So whenevr you connect from Box A to Box B you need not type the password. Please confirm whether you have done the above