curs.execute("SELECT userid,sshkey FROM git_users ORDER BY userid")
                f = open("%s/.ssh/authorized_keys.tmp" % self.conf.get("paths", "githome"), "w")
                for userid,sshkey in curs:
-                       f.write("command=\"%s %s\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s\n" % (self.conf.get("paths", "pggit"), userid, sshkey))
+                       for key in sshkey.split("\n"):
+                               f.write("command=\"%s %s\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s\n" % (self.conf.get("paths", "pggit"), userid, key))
                f.close()
                os.chmod("%s/.ssh/authorized_keys.tmp" % self.conf.get("paths", "githome"), 0600)
                os.rename("%s/.ssh/authorized_keys.tmp" % self.conf.get("paths", "githome"), "%s/.ssh/authorized_keys" % self.conf.get("paths", "githome"))