albertofem/rsync-lib

Public key / Private key

Closed this issue · 2 comments

I believe your setter methods are saying "public key" when you mean "private key" across all cases related to the SSH portion of rsync.

From the man page:

-i identity_file
Selects a file from which the identity (private key) for public key authentication is read. The default is ~/.ssh/identity for protocol
version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa and ~/.ssh/id_rsa for protocol version 2. Identity files may also be specified on a per-
host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in configuration
files). ssh will also try to load certificate information from the filename obtained by appending -cert.pub to identity filenames.

Or maybe I'm misunderstanding the intent of that portion of code!

That seems to be the case. The SSH command flag -i is the identity file flag.

-i identity_file
Selects a file from which the identity (private key) for RSA or DSA authentication is read. The default is ~/.ssh/identity for protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2. Identity files may also be specified on a per-host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in configuration files).

It seems the code is just labeled wrongly.

Fixed in master. I kept the old "public_key" as deprecated and will be removed in next major version.