简体   繁体   中英

Twisted Conch Packet Integrity Error

When I connect using Twisted conch I get Packet integrity error (6 bytes remaining) at serverloop.c:980 in the /var/log/secure.log After that the connection gets dropped ("Disconnecting: Packet integrity error")

The server is a VMware system, no firewalls or other security is between the systems. I also see that the authentication runs successfully (Accepted password for from port ssh2).

My ssh.py is nearly the same as the example:

class SSHCommandChannel(channel.SSHChannel):
    name = "session"
    def __init__(self, eventparser, *args, **kwargs):
        channel.SSHChannel.__init__(self, *args, **kwargs)

    def _cbSendRequest(self, data):
        print("%s" % data)
        self.conn.sendEOF(self)

    def channelOpen(self, data):
        d = self.conn.sendRequest(self, 'exec', common.NS(data), wantReply=True)
        d.addCallback(self._cbSendRequest)
        return None

    def extReceived(self, dataType, data):
        self.dataRecieved(data)

    def dataRecieved(self, data):
        print("w00t: %s" % data)

    def closed(self):
        print("Channel closed =(")

I have no idea how to continue my quest on getting this example to work. Any advice would be appreciated.

My guess is that you're passing strange data to the exec request. I don't recall offhand what the data passed to the client side of a channel is, but you probably don't want to be sending it back to the server. The server is expecting an NS-encoded command to execute, not random data. Unfortunately I can't reproduce the error your seeing here on my Mac, but hopefully this points you in the right direction!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM