Saturday, October 20, 2018

Python and JunOS

For those who work in a Juniper shop, how do you change your local password?

I was using the netmiko module and a for loop to change my local account password. For Cisco and Brocade, this works, but with JunOS it does not. Not exactly sure what to do with this one.

for i in junos_list: userssh = ConnectHandler(device_type='juniper_junos', ip=i, port=22, username=username, password=password) la_login_cred = ('set system login user ' + local_username + ' authentication plain-text-password') la_login_passwd = (local_password) la_login_confirm_passwd = (local_password) userssh.send_config_set(la_login_cred) userssh.send_config_set(la_login_passwd) userssh.send_config_set(la_login_confirm_passwd) userssh.disconnect() print("\n\tPassword has been updated for", i) 



No comments:

Post a Comment