Commit 38cae93c authored by liuzheng712's avatar liuzheng712

Merge branch 'dev' of github.com:jumpserver/coco into dev

parents 3b277ec4 aa72fc59
......@@ -280,6 +280,8 @@ class Coco:
def put_command_queue(self, session, _input, _output):
logger.debug("Put command data: {} {} {}".format(session, _input, _output))
if not _input:
return
self._command_queue.put({
"session": session.id,
"input": _input[:128],
......
......@@ -64,7 +64,7 @@ class SSHInterface(paramiko.ServerInterface):
def check_auth_publickey(self, username, key):
key = key.get_base64()
valid = self.validate_auth(username, key=key)
valid = self.validate_auth(username, public_key=key)
if not valid:
logger.debug("Public key auth <%s> failed, try to password" % username)
return paramiko.AUTH_FAILED
......@@ -72,10 +72,10 @@ class SSHInterface(paramiko.ServerInterface):
logger.debug("Public key auth <%s> success" % username)
return paramiko.AUTH_SUCCESSFUL
def validate_auth(self, username, password="", key=""):
def validate_auth(self, username, password="", public_key=""):
user, _ = self.app.service.authenticate(
username, password=password, pubkey=key,
remote_addr=self.request.remote_ip, login_type="ST"
username, password=password, public_key=public_key,
remote_addr=self.request.remote_ip,
)
if user:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment