Write the input that your command needs to the stdin
:
stdin, stdout, stderr = self.client.exec_command(command)
stdin.write(name + '\n')
stdin.flush()
(You will of course need to propagate the name
variable from module
to sendCommand
, but I assume you know how to do that part).
More Related Contents:
- Executing command using “su -l” in SSH using Python
- Paramiko authentication fails with “Agreed upon ‘rsa-sha2-512’ pubkey algorithm” (and “unsupported public key algorithm: rsa-sha2-512” in sshd log)
- Paramiko “Unknown Server”
- Is there a simple way to get rid of junk values that come when you SSH using Python’s Paramiko library and fetch output from CLI of a remote machine?
- Execute multiple commands in Paramiko so that commands are affected by their predecessors
- Python Paramiko – Run command
- Python – pysftp / paramiko – Verify host key using its fingerprint
- standard_init_linux.go:178: exec user process caused “exec format error”
- Python subprocess .check_call vs .check_output
- Port forwarding with Paramiko
- Paramiko’s SSHClient with SFTP
- Get output from a Paramiko SSH exec_command continuously
- Paramiko and Pseudo-tty Allocation
- Multi-factor authentication (password and key) with Paramiko
- Automate ssh connection and execution of program with Python’s Paramiko
- How to store the result of an executed shell command in a variable in python? [duplicate]
- Long-running ssh commands in python paramiko module (and how to end them)
- Paramiko with continuous stdout
- Sending a password over SSH or SCP with subprocess.Popen
- Fetching the output of a command executed through os.system() command [duplicate]
- Execute multiple dependent commands individually with Paramiko and find out when each command finishes
- Execute (sub)commands in secondary shell/command on SSH server in Python Paramiko
- Nested SSH session with Paramiko
- PYTHONPATH not working for sudo on GNU/Linux (works for root)
- Change working directory in shell with a python script
- “Failed to load HostKeys” warning while connecting to SFTP server with pysftp
- Wait until task is completed on Remote Machine through Python [duplicate]
- List files on SFTP server matching wildcard in Python using Paramiko
- How to execute a script remotely in Python using SSH?
- python paramiko ssh