it worked. But now I am having a new problem. I am able to login to server using paramiko. But cant execute any commands. My code is as follows. I am suspecting issues with connection.send command.
session = paramiko.SSHClient()
connection = session.invoke_shell()
Take a look at this demo for the paramiko package.
After connecting to the server, like in the demo, this is how I would edit the remote file:
with sftp.open("yourfiletoedit", "rb") as f: data = f.read() # modify the data of the file (this depends on the format wich was not specified) with sftp.open("yourfiletoedit", "wb") as f: f.write(data)