Skip to main content

Out of tree netmiko driver for 2FA with google-authenticator

Project description

netmiko_2fa_google_authenticator is an out of tree netmiko driver for 2FA with google-authenticator.

Installation

Install the netmiko google-authenticator driver by running:

pip3 install netmiko_2fa_google_authenticator

Usage

from netmiko import ConnectHandler
import  netmiko_2fa_google_authenticator

target = {
    'device_type': '2fa_google_authenticator',
    'target_device_type': 'linux',
    'ip': ssh_host, # ip of host
    'username': ssh_username, # username
    'password': [ssh_password,authenticator_otp], # password list [<server_password>,<google otp>]
    'port': 22,
}

target2 = {
    'device_type': '2fa_google_authenticator',
    'target_device_type': 'linux',
    'ip': ssh_host, # ip of host
    'username': ssh_username, # username
    'password': ssh_password, # password <server_password>
    'port': 22,
    'otp_secret': authenticator_secret # secret shown by google-authenticator at setup

}

ssh = ConnectHandler(**target)
print(ssh.send_command("ls /"))
ssh = ConnectHandler(**target2)
print(ssh.send_command("ls /"))

Contribute

License

This project is licensed under the Apache License Version 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

Details for the file netmiko_2fa_google_authenticator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for netmiko_2fa_google_authenticator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 964ac7ea8934e132489b89e6506e231fb5fb68b387f88fa07789e4b71e22cabd
MD5 0f1c3bf9531aee6806f5b385c2e27a58
BLAKE2b-256 4c413b376c483fa93b675fde854f887ec64989b7e38f5190da642027dbece782

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page