RemoteConnect["host"]
connects to the specified remote host.
RemoteConnect[IPAddress["address"]]
connects to the machine with the specified IP address.
RemoteConnect["host",username]
connects using the specified username for the remote host.
RemoteConnect["host",username,password]
connects using the specified username and password.
RemoteConnect
RemoteConnect["host"]
connects to the specified remote host.
RemoteConnect[IPAddress["address"]]
connects to the machine with the specified IP address.
RemoteConnect["host",username]
connects using the specified username for the remote host.
RemoteConnect["host",username,password]
connects using the specified username and password.
Details and Options
- RemoteConnect returns a RemoteConnectionObject.
- RemoteConnect["host"] prompts for a username and password.
- RemoteConnect["user@host"] prompts for a password only.
- RemoteConnect["user@host",password] can be used to specify both username and password.
- RemoteConnect will use an SSH agent for authentication if available.
- RemoteConnect 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 used 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.
- RemoteConnect["host",username,password] is equivalent to RemoteConnect["host",Authentication-><|"Username"->username,"Password"->password|>].
- With the setting RemoteAuthorizationCaching->True, RemoteConnect will cache authorization information remotely so as to allow passwordless connection.
Examples
open all close allBasic Examples (1)
remote = RemoteConnect["host.example.com"]Display the time since boot for the remote machine:
RemoteRunProcess[remote, "uptime", "StandardOutput"]Issue multiple commands in a single session:
RemoteRunProcess[remote, "pwd", "StandardOutput"]
RemoteRunProcess[remote, "cd ..", "StandardOutput"]
RemoteRunProcess[remote, "pwd", "StandardOutput"]Write to the object like a stream:
WriteLine[remote, "pwd"]Read from the object like a stream:
ReadString[remote]DeleteObject[remote]Scope (1)
Options (4)
Authentication (3)
Use the Authentication option to provide a username and/or password:
remote = RemoteConnect["host.example.com", Authentication -> <|"Username" -> "username", "Password" -> password|>]Connect using an identity file for authentication:
RemoteConnect["host.example.com" , Authentication -> <|"Username" -> "user", "SSHKey" -> File["/path/.ssh/id_rsa"]|>]Set a value for $SSHAuthentication:
$SSHAuthentication = <|"Username" -> "user", "Password" -> password|>Use the default authentication contained in $SSHAuthentication to connect:
RemoteConnect["host.example.com"]RemoteAuthorizationCaching (1)
Use the RemoteAuthorizationCaching option to save a public key on the remote host:
remote = RemoteConnect["host.example.com", RemoteAuthorizationCaching -> True]DeleteObject[remote]Now a connection can be made without requiring a prompt:
remote = RemoteConnect["host.example.com"]DeleteObject[remote]Neat Examples (1)
remote = RemoteConnect["host.example.com"]Define a function that will run evaluations via wolframscript on a remote machine:
Attributes[RemoteWolframScript] = {HoldAllComplete};RemoteWolframScript[remote_, expr_] := Module[{compressed},
compressed = ExportString[ToString[Hold[expr], InputForm], "Base64"];
ToExpression[RemoteRunProcess[remote, "wolframscript -format InputForm -code 'ReleaseHold[ImportString[\"" <> compressed <> "\",\"Base64\"]]'", "StandardOutput"]]]Evaluate $MachineName both locally and remotely:
{$MachineName, RemoteWolframScript[remote, $MachineName]}Evaluate $MachineID both locally and remotely:
{$MachineID, RemoteWolframScript[remote, $MachineID]}DeleteObject[remote]Related Guides
History
Text
Wolfram Research (2018), RemoteConnect, Wolfram Language function, https://reference.wolfram.com/language/ref/RemoteConnect.html.
CMS
Wolfram Language. 2018. "RemoteConnect." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RemoteConnect.html.
APA
Wolfram Language. (2018). RemoteConnect. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RemoteConnect.html
BibTeX
@misc{reference.wolfram_2026_remoteconnect, author="Wolfram Research", title="{RemoteConnect}", year="2018", howpublished="\url{https://reference.wolfram.com/language/ref/RemoteConnect.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_remoteconnect, organization={Wolfram Research}, title={RemoteConnect}, year={2018}, url={https://reference.wolfram.com/language/ref/RemoteConnect.html}, note=[Accessed: 12-June-2026]}