RemoteRun
RemoteRun["host","command"]
runs the specified operating system command on the remote host, returning the exit code obtained.
RemoteRun[IPAddress["address"],"command"]
runs the command on the machine with the specified IP address.
RemoteRun[obj,"command"]
run the command on the remote host specified by the RemoteConnectionObject obj.
Details and Options
- RemoteRun["host","command"] by default prompts for a username and password.
- RemoteRun["user@host",…] prompts for a password only.
- RemoteRun will use an ssh-agent for authentication if available.
- RemoteRun allows the following options:
-
Authentication $SSHAuthentication authentication parameters for the connection RemoteAuthorizationCaching False whether to use remote authorization caching - In the form Authentication->assoc, the association assoc can contain these keys:
-
"Username" username to use for authentication "Password" password to use for authentication "SSHKey" SSH identity "SSHKeyPassword" passphrase string to use to decrypt SSHKey - An SSH identity can be given in the form "SSHKey"->File[ident], where ident is a file containing an SSH private key. It can also be given as "SSHKey"->"string", where "string" is an SSH private key.
- RemoteRun returns the error code of the remote "command".
Examples
open allclose allBasic Examples (3)
Run a Wolfram script located on the remote host:
Append text to a file on the remote host:
Check the contents of that file using RemoteRunProcess:
Scope (1)
Create a persistent session with RemoteConnect:
Once the session is created, it can be used without having to reconnect:
Options (4)
Authentication (3)
Run a remote command using username and password authentication:
Run a remote command using an identity file for authentication:
Set a value for $SSHAuthentication:
Now commands can be run using the default authentication contained in $SSHAuthentication:
Possible Issues (1)
RemoteRun prompts for a username and password. If neither is provided, RemoteRun issues a warning message and returns $Failed:
If either the username or password is entered incorrectly, RemoteRun issues a warning message and returns $Failed:
If a remote machine cannot be found on the network, RemoteRun issues a warning message and returns $Failed:
Text
Wolfram Research (2018), RemoteRun, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoteRun.html.
CMS
Wolfram Language. 2018. "RemoteRun." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RemoteRun.html.
APA
Wolfram Language. (2018). RemoteRun. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoteRun.html