code: private static boolean validateRemote(String node, String target, String name, CommandLine cmd)
        throws InterruptedException {
      System.out.format("Validating %s environment on %s...%n", target, node);
      if (!Utils.isAddressReachable(node, 22)) {
        System.err.format("Unable to reach ssh port 22 on node %s.%n", node);
        return false;
      }
  
      // args is not null.
      String argStr = String.join(" ", cmd.getArgs());
      String homeDir = ServerConfiguration.get(PropertyKey.HOME);
      String remoteCommand = String.format(
          "%s/bin/alluxio validateEnv %s %s %s",
          homeDir, target, name == null ? "" : name, argStr);
      String localCommand = String.format(
          "ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no -tt %s \"bash %s\"",
          node, remoteCommand);
      String[] command = {"bash", "-c", localCommand};
      try {
        ProcessBuilder builder = new ProcessBuilder(command);
        builder.redirectErrorStream(true);
        builder.redirectOutput(ProcessBuilder.Redirect.INHERIT);
        builder.redirectInput(ProcessBuilder.Redirect.INHERIT);
        Process process = builder.start();
        process.waitFor();
        return process.exitValue() == 0;
      } catch (IOException e) {
        System.err.format("Unable to validate on node %s: %s.%n", node, e.getMessage());
        return false;
      }
    }
docs: validates environment on remote node