def validate_ssh_credentials(self, cur_message):
        
        results             = build_dict("FAILED", "Not Valid", {})

        try:

            self.m_cur_count        += 1

            self.lg("Handling - Validating SSH Credentials(" + str(json.dumps(cur_message)) + ")", 6)

            ssh_host        = str(cur_message["Host"])
            ssh_user        = str(cur_message["User"])

            commands_to_run = cur_message["Commands"]
            count_idx       = 0

            valid_setup     = False

            for ssh_command in commands_to_run:
                
                # Allow for edits before running:
                remote_command  = str(ssh_command)

                proc            = subprocess.Popen(remote_command, shell=True, stdout=subprocess.PIPE)
                std_rows        = proc.communicate()[0].split("\n")
            
                if len(std_rows) == 1:
                    valid_setup = False
                else:
                    lg("\tSSH Credentials Validated(" + str(ssh_host) + ")", 5)
                    valid_setup = True

            # end of for all commands

            if valid_setup:
                results     = build_dict("SUCCESS", "SSH Credentials Validated", {})
            else:
                err_msg     = "SSH Validation Failed Please run: ssh-copy-id root@" + str(ssh_host)
                self.elg(err_msg, True)
                results     = build_dict("FAILED", str(err_msg), {})

        except Exception,k:
            err_msg         = "Failed Validating SSH Credentials Number(" + str(self.m_message_number) + ") Message(" + str(cur_message) + ") with Ex(" + str(k) + ")"
            self.elg(err_msg, True)
            results         = build_dict("FAILED", str(err_msg), {})

            self.m_message_number   += 1
        # end of try/ex

        return results
    # end of validate_ssh_credentials
Validate the SSH Credentials are working without password for cluster control: 
dataset/ETHPy150Open GetLevvel/message-simulator/src/rabbit_message_publisher.py/RabbitMessagePublisher.validate_ssh_credentials