The client first tries to authenticate using a private key, either from ssh-agent
or /.ssh/id_rsa
in the user home directory. If this fails it falls back on
challenge-response (interactive) and password auth if allowed by the server. The
passwd
parameter can be used to provide a passphrase or a callback function to
ask prompt the user for the passphrase when needed.
The session will automatically be disconnected when the session object is removed
or when R exits but you can also use ssh_disconnect()
.
Windows users: the private key must be in OpenSSH PEM format. If you open it in
a text editor the first line must be: -----BEGIN RSA PRIVATE KEY-----
.
To convert a Putty PKK key, open it in the PuttyGen utility and go to
Conversions -> Export OpenSSH.