0

After creating the keys and use ssh-copy-id command successfully, I can connect by ssh user@host but when I'm trying to do a transfer via rsync and it asks for password... rsync command is as follows:

rsync -av -e "ssh -o PubkeyAuthentication=yes -o PasswordAuthentication=no -X user@hostname" /home/Compart user@hostname:/home/user/backup/

I already tried:

rsync -av --rsh="ssh -l user" /home/Compart user@hostname:/home/user/backup/
rsync -av -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" /home/Compart user@hostname:/home/user/backup/

and still nothing... always asks for a password...

#tail -f /var/log/auth.log
Oct 27 11:48:42 hostname sshd[15531]: Accepted password for user from 10.14.6.93 port 41893 ssh2
Oct 27 11:48:42 hostname sshd[15531]: pam_group(sshd:setcred): bad group: powerdev
Oct 27 11:48:42 hostname sshd[15531]: pam_group(sshd:setcred): bad group: libvirt
Oct 27 11:48:42 hostname sshd[15531]: pam_group(sshd:setcred): bad group: kvm
Oct 27 11:48:42 hostname sshd[15531]: pam_group(sshd:setcred): bad group: sane
Oct 27 11:48:42 hostname sshd[15531]: pam_unix(sshd:session): session opened for user user by (uid=0)
Oct 27 11:48:42 hostname systemd-logind[879]: New session 39 of user user.
Oct 27 11:48:42 hostname sshd[15615]: pam_group(sshd:setcred): bad group: powerdev
Oct 27 11:48:42 hostname sshd[15615]: pam_group(sshd:setcred): bad group: libvirt
Oct 27 11:48:42 hostname sshd[15615]: pam_group(sshd:setcred): bad group: kvm
Oct 27 11:48:42 hostname sshd[15615]: pam_group(sshd:setcred): bad group: sane
Oct 27 11:48:42 hostname sshd[15615]: Received disconnect from 10.14.6.93: 11: disconnected by user
Oct 27 11:48:42 hostname sshd[15531]: pam_unix(sshd:session): session closed for user user
Oct 27 11:48:54 hostname systemd-logind[879]: Removed session 39.

Where 10.14.6.93 is the machine where the files are right now and where the rsync is being executed...

any ideas?

  • Use ... -e "ssh -i /path/to/private-key ..." to make sure SSH is using the key. Take a look at this question if it helps: askubuntu.com/questions/521142/… – Alaa Ali Oct 27 '14 at 17:30
  • I'v read this post and tried some procedures sugested there but nothing worked. I'll try the -e "ssh -i /path/to/private-key" as soon as I have access to the pc... – Heathz Oct 29 '14 at 10:27
0

The following command uses my pubkey and does not ask for a password even though I have both a valid password and valid pubkey for the remote host. Also make sure you don't have a password set in .ssh/config just to be safe.

rsync -av /home/user user@hostname:/home/user/backup

  • I have no config at ~/.ssh/ and using the command the way you said still asks for password – Heathz Oct 29 '14 at 10:24

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.