diff --git a/changelog.d/4060.bugfix b/changelog.d/4060.bugfix
new file mode 100644
index 0000000000000000000000000000000000000000..78d69a8819af6b904bda3e7c844887f7839c9a6c
--- /dev/null
+++ b/changelog.d/4060.bugfix
@@ -0,0 +1 @@
+Manhole now works again on Python 3, instead of failing with a "couldn't match all kex parts" when connecting.
diff --git a/synapse/util/manhole.py b/synapse/util/manhole.py
index 8d0f2a8918110986014d7dd27f8e5defeb5515f6..cf43ab6a19b440a35c3daff7df7212e84816d531 100644
--- a/synapse/util/manhole.py
+++ b/synapse/util/manhole.py
@@ -82,7 +82,7 @@ def manhole(username, password, globals):
     )
 
     factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker]))
-    factory.publicKeys['ssh-rsa'] = Key.fromString(PUBLIC_KEY)
-    factory.privateKeys['ssh-rsa'] = Key.fromString(PRIVATE_KEY)
+    factory.publicKeys[b'ssh-rsa'] = Key.fromString(PUBLIC_KEY)
+    factory.privateKeys[b'ssh-rsa'] = Key.fromString(PRIVATE_KEY)
 
     return factory