Skip to content

Commit

Permalink
Merge 59abe5e into 8b37601
Browse files Browse the repository at this point in the history
  • Loading branch information
z3r03nna committed Dec 7, 2017
2 parents 8b37601 + 59abe5e commit ae9313d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions netconf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,16 @@ def get_allowed_auths (self, username):
users = [ username ]
else:
users = self.users
allowed = []
allowed = ""
if username in users:
if self.pam:
allowed.append("password")
allowed += "password"

if self.get_user_auth_keys(username):
if allowed != "":
allowed += ","
allowed.append("publickey")
logger.debug("Allowed methods for user %s: %s", str(username), str(allowed))
logger.debug("Allowed methods for user %s: %s", str(username), allowed)
return allowed

def check_auth_none (self, unused_username):
Expand Down Expand Up @@ -165,7 +167,7 @@ def __init__ (self, username=None, password=None):
self.event = threading.Event()

def get_allowed_auths (self, unused_username):
return ["password"]
return "password"

def check_auth_none (self, unused_username):
return ssh.AUTH_FAILED
Expand Down

0 comments on commit ae9313d

Please sign in to comment.