02-18-2023 07:04 PM
Hi,
Is there a way to change local credential of multiple FTD devices from CDO? If not, is there an easy way to accomplish this instead if manually doing it on individual devIces?
Thanks.
Solved! Go to Solution.
02-19-2023 07:38 AM
used long back in my lab test it before make a mass use :
#FTD password change beta script
from netmiko import ConnectHandler
# Define the device information and new password
device = {
"device_type": "cisco_ftd_ssh",
"ip": "192.168.1.1",
"username": "admin",
"password": "oldpassword",
}
new_password = "newpassword"
# Connect to the FTD device using Netmiko
ssh_conn = ConnectHandler(**device)
# Use the CLI to change the password
ssh_conn.send_command_timing("configure password " + new_password)
# Save the configuration
ssh_conn.send_command_timing("write memory")
# Close the SSH connection
ssh_conn.disconnect()
02-19-2023 01:18 AM
Not that i have come across that option to change, you can do automation to change all the devices local passwords using any script like python.
Note: if anywhere you using the admin account for some reason that place is also required to change, do not lockout yourself, so make sure an equivalent admin account is created or available for your to change.
02-19-2023 05:45 AM
Hi Balaji,
Thank you for your suggestion. I am new to scripting, I can login to the FTD via Python script but I can't figure out how to script the password change command. Any suggestion?
02-19-2023 07:38 AM
used long back in my lab test it before make a mass use :
#FTD password change beta script
from netmiko import ConnectHandler
# Define the device information and new password
device = {
"device_type": "cisco_ftd_ssh",
"ip": "192.168.1.1",
"username": "admin",
"password": "oldpassword",
}
new_password = "newpassword"
# Connect to the FTD device using Netmiko
ssh_conn = ConnectHandler(**device)
# Use the CLI to change the password
ssh_conn.send_command_timing("configure password " + new_password)
# Save the configuration
ssh_conn.send_command_timing("write memory")
# Close the SSH connection
ssh_conn.disconnect()
02-20-2023 11:40 AM
Thank you for sharing the script Balaji. I was a be to accomplish what I need to do.
I had to use a list for the password change command like the one below.
cmd_list=[
"configure password",
"current_password",
"new_password",
"confirm_new_password!"
]
ssh_conn.send_multiline_timing(cmd_list)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide