Using the standard client.open_sftp()
handle gives me SFTP controls but without sudo/root permissions, any sort of /etc/**
files can't be edited. I have a user that has passwordless sudo access, I figured I could maybe start off with sudo su
and then invoke SFTP but that did not seem to be the case.
t = paramiko.Transport(('192.168.56.102', 22))
t.connect(username='vagrant', password='vagrant')
chan = t.open_session()
chan.get_pty()
chan.invoke_subsystem('sftp')
chan.exec_command('sudo su')
sftp = paramiko.SFTPClient.from_transport(t)
.. the error
paramiko.ssh_exception.SSHException: Channel closed.
DEBUG:paramiko.transport:EOF in transport thread
Any tips how to get Paramiko to open SFTP with sudo access?