Use SSH $ RemoteNode <cmd> to execute commands on a remote machine locally, for example, ssh user @ node ls/local will execute the ls/local command on the remote machine. If you want to execute multiple commands continuously on the remote machine, these commands can be enclosed in single or double quotes, for example, ssh user @ node "cd/local; pwd; ls "if you want to start the command on the remote machine locally and then return it, you can use ssh user @ node"/local/x. sh 1>/dev/null 2> & 1 & "note that if there is no" ", for example, ssh user @ node cd/local; ls, ls will only execute the cd/local command, if the ls command is executed locally and double quotation marks or single quotation marks are added, the enclosed command is used as a parameter of the ssh command, so it will be executed remotely. Differences between single quotation marks and double quotation marks in the ssh command: an example is provided to illustrate the problem. Assume that JAVA environment variables are configured on the local machine, run echo $ JAVA_HOME =/opt/jdk locally. If you want to view the JAVA environment variables on a remote machine, you can only use single quotes. ssh user @ node 'echo $ Java ', $ JAVA in ''is not parsed by shell, but is treated as a string. echo $ JAVA is passed to ssh. If we use ssh user @ node" echo $ JAVA ", then shell will first parse $ JAVA and get its value, then the command will become ssh user @ node 'echo/opt/jdk'