Junos OS

 View Only
last person joined: 2 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  Orchestrating passwords with Ansible

    Posted 05-24-2018 08:43

    I want to use an Ansible script to create/update a user's password. 

    I'm trying 'junos_config' and 'junos_command' modules to issue 'set' commands. 

    The 'encrypted-password' option needs a hash which I'm using python to create, but that's not working.  

    I've read this page, https://kb.juniper.net/InfoCenter/index?page=content&id=KB31903

    I've tried MD5 with a leading "$1$" and SHA256 with a leading "$5$".

    I think I'm missing a salt, but I'm not sure.

     

    How can I generate the hash manually to use with Ansible?


    #Ansible
    #JUNOS
    #Encryption


  • 2.  RE: Orchestrating passwords with Ansible
    Best Answer

    Posted 05-24-2018 09:49

    I switch the python library I was using and it is working now.

    sha256_crypt.encrypt(password)