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

Examples

Basic Examples  (1)

Insert text into a file on the remote host:

In[1]:=
Click for copyable input
Out[1]=

Check the contents of that file using RemoteRunProcess:

In[2]:=
Click for copyable input
Out[2]=

Run a command that will return an exit code:

In[3]:=
Click for copyable input
Out[3]=

Run a script located on the remote host:

In[4]:=
Click for copyable input
Out[4]=

Provide authentication without a prompt:

In[5]:=
Click for copyable input
Out[5]=

Authorize future connections by placing the public key on the remote machine:

In[6]:=
Click for copyable input
Out[6]=

The user is now authorized to execute commands without authentication:

In[7]:=
Click for copyable input
Out[7]=

Create a persistent session with RemoteConnect:

In[8]:=
Click for copyable input
Out[8]=

Once the session is created, it can be used without having to reconnect:

In[9]:=
Click for copyable input
Out[9]=

Close the session:

In[10]:=
Click for copyable input

See Also

RemoteRunProcess  Run  RunProcess  RemoteConnect

Introduced in 2018
(11.3)