In work, it is often necessary to submit nodes locally and remotely log in to other nodes to execute some shell commands. If you ssh to each remote host separately, it will be very troublesome to execute each command. If you can directly ssh to each remote host to execute commands on the submission node, you can save the trouble of logging in one by one.
Realize the function:
You need to configure ssh password-free login. You can directly skip the login password and log in to the remote host directly, which is very critical when executing in shell scripts.
Operation script:
Create a new shell script with the following content.