w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
paramiko.SSHException: Channel closed
import paramiko
s = paramiko.SSHClient()
conn = s.connect(hostIP, username ='root', password='rootpassword',

command = 'pwd'
(stdin, stdout, stderr) = s.exec_command(command)

print stdout.read()

This should work fine with root user on linux. If it's not, you are probably passing wrong values for hostIP (for ex: quotes in the value), username, password.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.