Learn R Programming

git2r (version 0.21.0)

cred_ssh_key: Create a new passphrase-protected ssh key credential object

Description

Create a new passphrase-protected ssh key credential object

Usage

cred_ssh_key(publickey = "~/.ssh/id_rsa.pub", privatekey = "~/.ssh/id_rsa",
  passphrase = character(0))

Arguments

publickey

The path to the public key of the credential. Default is '~/.ssh/id_rsa.pub'

privatekey

The path to the private key of the credential. Default is '~/.ssh/id_rsa'

passphrase

The passphrase of the credential. Default is character(0). If getPass is installed and private key is passphrase protected getPass::getPass() will be called to allow for interactive and obfuscated interactive input of the passphrase.

Value

A S4 cred_ssh_key object

See Also

Other git credential functions: cred_env, cred_token, cred_user_pass

Examples

Run this code
# NOT RUN {
## Create a ssh key credential object. It can optionally be
## passphrase-protected
cred <- cred_ssh_key("~/.ssh/id_rsa.pub", "~/.ssh/id_rsa")
repo <- repository("git2r")
push(repo, credentials = cred)
# }

Run the code above in your browser using DataLab