2012-07-04 10:37:40+0300 [SSHService ssh-userauth on SSHServerTransport,0,127.0.0.1] user trying auth password
2012-07-04 10:37:40+0300 [SSHService ssh-userauth on SSHServerTransport,0,127.0.0.1] user authenticated with password
2012-07-04 10:37:40+0300 [SSHService ssh-userauth on SSHServerTransport,0,127.0.0.1] starting service ssh-connection
2012-07-04 10:37:40+0300 [SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] got channel session request
2012-07-04 10:37:40+0300 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] channel open
2012-07-04 10:37:40+0300 [SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] got channel session request
2012-07-04 10:37:40+0300 [SSHChannel session (1) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] channel open
2012-07-04 10:37:40+0300 [SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] got channel session request
2012-07-04 10:37:40+0300 [SSHChannel session (2) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] channel open
2012-07-04 10:37:40+0300 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] executing command "true"
2012-07-04 10:37:40+0300 [SSHChannel session (0) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] Unhandled Error
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\twisted\python\log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 81, in callWithContext
return func(*args,**kw)
File "C:\Python27\lib\site-packages\twisted\conch\ssh\channel.py", line 137, in requestReceived
return f(data)
--- <exception caught here> ---
File "C:\Python27\lib\site-packages\twisted\conch\ssh\session.py", line 68, in request_exec
self.session.execCommand(pp, f)
File "sshsimpleserver.py", line 79, in execCommand
raise Exception("no executing commands")
exceptions.Exception: no executing commands
2012-07-04 10:37:40+0300 [SSHChannel session (1) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] executing command "false"
2012-07-04 10:37:40+0300 [SSHChannel session (1) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] Unhandled Error
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\twisted\python\log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 81, in callWithContext
return func(*args,**kw)
File "C:\Python27\lib\site-packages\twisted\conch\ssh\channel.py", line 137, in requestReceived
return f(data)
--- <exception caught here> ---
File "C:\Python27\lib\site-packages\twisted\conch\ssh\session.py", line 68, in request_exec
self.session.execCommand(pp, f)
File "sshsimpleserver.py", line 79, in execCommand
raise Exception("no executing commands")
exceptions.Exception: no executing commands
2012-07-04 10:37:40+0300 [SSHChannel session (2) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] executing command "cat"
2012-07-04 10:37:40+0300 [SSHChannel session (2) on SSHService ssh-connection on SSHServerTransport,0,127.0.0.1] Unhandled Error
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\twisted\python\log.py", line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "C:\Python27\lib\site-packages\twisted\python\context.py", line 81, in callWithContext
return func(*args,**kw)
File "C:\Python27\lib\site-packages\twisted\conch\ssh\channel.py", line 137, in requestReceived
return f(data)
--- <exception caught here> ---
File "C:\Python27\lib\site-packages\twisted\conch\ssh\session.py", line 68, in request_exec
self.session.execCommand(pp, f)
File "sshsimpleserver.py", line 79, in execCommand
raise Exception("no executing commands")
exceptions.Exception: no executing commands
SSH Server через twisted
http://twistedmatrix.com/documents/current/conch/examples/sshsimpleserver.py
http://twistedmatrix.com/documents/current/conch/examples/sshsimpleclient.py
Они не работают. Сервер стартует, запускается, открываю на него этот же клиент. На клиенте выскакивает запрос пароля, на сервере в это время все нормально.
Ввожу пароль, теперь на клиенте ошибка "Unhandled error in deffered", на сервере куча ошибок:
Код:
Ошибки выдает сервер уже после подключения в функции execCommand raise Exception("no executing commands"). Добавь в эту функцию обработку своих комманд или убери из сорсов и все комманды выполняй через shell (как с cat пример в самом конце)
Это нормально. Так и должно быть.
Хм, но коннект-то в итоге не устанавливается вроде. Ибо на клиенте тоже ошибка вылетает. Или это он так установился с ошибками и дальше можно вводить что надо? )