I am trying to check if a remote file is writable or not using paramiko.
My current code is
from paramiko.ssh_exception import SSHException, BadHostKeyException
import paramiko
import sys
from optparse import OptionParser
import os
stdin, stdout, stderr = self.__econnection.exec_command('bash');
stdin.write('if [ -w "%s" ];'%(temp_path))
stdin.write("then echo True;");
stdin.write("else echo False;");
stdin.write("fi;");
stdin.flush();
But as soon I execute these lines, the shell just gets stuck and I have to close the shell.
Please help..
assuming ssh is your paramiko SSHClient object, temp_path the path to the file under test, and the connection is already setup try the following: