我正试图通过paramiko运行一个交互式命令.cmd执行尝试提示输入密码但我不知道如何通过paramiko的exec_command提供密码并且执行挂起.如果cmd执行需要交互式输入,有没有办法将值发送到终端?
ssh = paramiko.SSHClient()
ssh.connect(server, username=username, password=password)
ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command("psql -U factory -d factory -f /tmp/data.sql")
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?谢谢.