Get_allowed_auths () in paramiko for authentication types

I am trying to get supported authentication types / methods from a running SSH server in Python.

I found this get_allowed_auths () method in the ServerInterface class in Paramiko, but I can’t figure out if it can be used in a simple client code snippet (I am writing something that is performed ONLY by this task).

Can someone offer me some links with examples and another one with distribution documentation? Maybe any other ideas for this?

Thanks.

+3
source share
1 answer

, , , , . auth_none() , paramiko.Transport.

import paramiko
import socket

s = socket.socket()
s.connect(('localhost', 22))
t = paramiko.Transport(s)
t.connect()

try:
    t.auth_none('')
except paramiko.BadAuthenticationType, err:
    print err.allowed_types
+4

Source: https://habr.com/ru/post/1714764/


All Articles