Forum Discussion
loveen_355250
Jun 30, 2018Nimbostratus
F5 root password change via python script issues
i am changing root password for mutiple f5's in my environment with a python script , somehow the script is not working as expected , i believe connection.recv is not able to get enough buffer here ...
Anesh
Jun 30, 2018Cirrostratus
i would suggest using the REST API available with F5 devices for automation, instead of using paramiko, you can use paramiko in use cases were a REST API is not availbe, for changing the root password an API is already availble you can refer to this
Sample code below:
>>> import requests
>>> import json
>>> requests.packages.urllib3.disable_warnings()
>>> b = requests.session()
>>> b.auth = ('admin', 'password')
>>> b.verify = False
>>> b.headers.update({'Content-Type':'application/json'})
>>> payload = { }
>>> payload['oldPassword'] = "password"
>>> payload['newPassword'] = "password1"
>>> b.post('https://192.168.190.130/mgmt/shared/authn/root', data=json.dumps(payload))
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects