paramiko

How to proceed with the word “MORE” to get to the end of the command

谁都会走 提交于 2020-08-26 10:34:05
问题 On a real device when I want to access "show gpon onu state" it takes a few presses of the space bar to get to the end of the line. for paramiko how to eliminate the word "more" so that you get to the end of the line? 回答1: There are several solution type for this case: Each brand has a screen-length command for this issue. You can enter this command first. Cisco : terminal length 0 Huawei : screen-length 0 temporary Nokia/Alcatel : environment no more cmd.send("terminal length 0" + '\r') time

Nested SSH with RSA key file

♀尐吖头ヾ 提交于 2020-08-26 07:00:09
问题 I am trying to nested SSH using Paramiko where I will connect to Server X from my local machine and from there I will connect to Server Y. Here to connect to Server X I am using username, password authentication and to connect to Server Y using username and RSA key. The thing is that the RSA key is hosted in System X which is used to connect Server Y. I was able to run the script successfully if I hosted the keyfile in my local PC and gave the local pc directory path to Paramiko SSH client.

pysftp: How to update last modified date

只谈情不闲聊 提交于 2020-08-26 06:58:10
问题 I am trying to move a certain file to another directory after doing some process over it. Moving the file was easy using Connection.rename import pysftp conn = pysftp.Connection(host = 'host', username = 'user', password = 'password') remote_src = '/dir1/file1.csv' remote_dest = '/dir2/archive_file1.csv' conn.rename(remote_src, remote_dest) conn.close() But the LastModified date remains same as of original file. Is there a way to update the LastModified date to current date while renaming?