`
shake863
  • 浏览: 637380 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

paramiko 的ssh登录

SSH 
阅读更多
import paramiko

socks=('192.168.48.129',22)
testssh=paramiko.Transport(socks)
testssh.connect(username='username',password='password')
sftptest=paramiko.SFTPClient.from_transport(testssh)

remotepath="/home/zhoudan/test.log"
localpath="D:\\test\\test.log"

sftptest.put(localpath,remotepath)

sftptest.close()

testssh.close()
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics