You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello an thanks for that library
Is it possible in ssh2-python to the current process running in a channel, like it is in the ssh specs ?
for instance on paramiko you basically can't but you can always hack it with the private API:
fromparamikoimportMessagefromparamiko.commonimportcMSG_CHANNEL_REQUESTfromsignalimportSignals# trigger termination with a standard openssh packet (since v7.6) but using the private API of paramiko because it doesn't natively implements it# spec: https://www.ietf.org/rfc/rfc4254.txtmessage=Message()
message.add_byte(cMSG_CHANNEL_REQUEST)
message.add_int(channel.remote_chanid)
message.add_string("signal")
message.add_boolean(False)
message.add_string(Signals.SIGTERM.name[3:])
client.get_transport()._send_user_message(message)
It would greatly help me since i'm using SIGTERM and SIGINT signals to stop the continuously running processes i'm starting over ssh
Activity
pkittenis commentedon Aug 25, 2025
Thanks for the interest.
The function libssh2 uses for passing ad-hoc signals is not implemented yet - would be
ssh2.Channel.signal.Added channel.signal function for sending signals to an open channel.…
Added Channel.signal function for sending signals to an open channel.