代码中连接服务器 并执行命令

import paramiko


ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(IP, port, username, password)
ssh.exec_command("python /usr/share/grafana/clear_grafana_cookie.py "+ user_name)

猜你喜欢

转载自blog.csdn.net/MasterD56/article/details/108405208