반응형
누구든지 파이썬에서 ssh 연결을 위해 무언가를 추천 할 수 있습니까? 모든 OS와 호환되어야합니다.
나는 이미 SIGCHLD에서 오류를 얻기 위해 pyssh를 시도했지만 Windows에는 이것이 부족하기 때문에 읽었습니다. 나는 paramiko를 작동 시키려고 노력했지만 paramiko와 Crypto 사이에 각각의 최신 버전이 함께 작동하지 않을 때까지 오류가 발생했습니다.
Python 2.6.1은 현재 Windows 시스템에 있습니다.
해결 방법
from pexpect import pxssh
s = pxssh.pxssh()
if not s.login ('localhost', 'myusername', 'mypassword'):
print "SSH session failed on login."
print str(s)
else:
print "SSH session login successful"
s.sendline ('ls -l')
s.prompt() # match the prompt
print s.before # print everything before the prompt.
s.logout()
일부 링크 :
참조 페이지 https://stackoverflow.com/questions/6188970
반응형
'파이썬' 카테고리의 다른 글
파이썬 Django : <여러 선택> 및 POST 사용 (0) | 2020.10.01 |
---|---|
파이썬에서 정수 값을 4 바이트 배열로 변환하는 방법 (0) | 2020.10.01 |
파이썬 How to implement an ordered, default dict? (0) | 2020.10.01 |
파이썬 How to trigger function on value change? (0) | 2020.10.01 |
파이썬 What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)? (0) | 2020.10.01 |
댓글