right now i'm using this code to syncronise stuff between my pcs:

nexus_ip=$(ip neigh | grep "nexus's mac addr" | grep -Eo '^[^ ]+')
function syncit () {
# rsync -rLEAXpogtP --delete "$1" "$2"
rsync -rulOHEAXpogtP --delete "$1" "$2"
while read source
        destination=$nexus_ip:$(echo "$source" | grep -o '^.*/')
        syncit "$source" "$destination"

i googled about getting ride of ssh's password while using rsync over network and all what i get that i should use "--files-from" to give rsync a list , and that way i'll enter the password just one time !

my problem is : how can i use --files-from ???

if i put all sources in a file ! what about destinations ???

i'm really confused ! any one could show me an example according to my script's infos ? please

  • Would shared ssh keys work to remove the password requirement? – David King Dec 8 '15 at 18:11

You can run

ssh-copy-id user@server

so you will never have to enter the passwort again.

Before that, you will have to create a local key, which you can do by running


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.