ssh_connect | R Documentation |
Create an ssh session using ssh_connect()
. The session can be used to execute
commands, scp files or setup a tunnel.
ssh_connect(host, keyfile = NULL, passwd = askpass, verbose = FALSE)
ssh_session_info(session)
ssh_disconnect(session)
libssh_version()
host |
an ssh server string of the form |
keyfile |
path to private key file. Must be in OpenSSH format (see details) |
passwd |
either a string or a callback function for password prompt |
verbose |
either TRUE/FALSE or a value between 0 and 4 indicating log level: 0: no logging, 1: only warnings, 2: protocol, 3: packets or 4: full stack trace. |
session |
ssh connection created with |
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.
Other ssh:
scp
,
ssh_credentials
,
ssh_exec
,
ssh_tunnel()
## Not run:
session <- ssh_connect("dev.opencpu.org")
ssh_exec_wait(session, command = "whoami")
ssh_disconnect(session)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.