Security · 4 min read

Rotating router and firewall credentials without an outage

Rotating credentials on production routers and firewalls is a critical security practice, but it carries real risk: a misconfigured command, a typo, or poor sequencing can lock you out or trigger an unexpected failover. The key is understanding your device architecture, preparing both the old and new credentials in advance, and following a vendor-specific procedure that preserves access at every step. This guide covers the practical mechanics of zero-downtime credential rotation across Cisco IOS, Juniper Junos, Palo Alto Networks, and Fortinet FortiOS.

Why credential rotation matters

Periodic password changes reduce the blast radius of a compromised account and help meet compliance requirements (PCI-DSS, SOC 2, HIPAA). However, network devices are different from servers: they are the path through which all traffic flows. A failed credential change can isolate your entire network. The solution is not to skip rotation, but to execute it methodically using parallel access methods and staged rollout.

Pre-rotation checklist

Cisco IOS credential rotation

On Cisco routers and switches, the standard approach is to create a new admin account while keeping the old one active, verify the new account works, then disable the old one. This two-step process eliminates lockout risk.

! Step 1: Create new admin account
config t
username admin-new privilege 15 secret <new-password>
exit

! Step 2: Verify new account works (log out and log back in as admin-new)
! If successful, proceed to step 3

! Step 3: Disable old account
config t
no username admin
end
write memory

For enable password (privileged EXEC mode), use the same pattern: set a new enable secret, test it, then remove the old one. Never change both at once.

Juniper Junos credential rotation

Junos uses a hierarchical user and class model. Create a new admin user in the same class, test access, then delete the old user.

! Step 1: Create new admin user
config
set system login user admin-new class super-user authentication encrypted-password "<hash>"
commit
exit

! Step 2: Test login as admin-new
! If successful, proceed to step 3

! Step 3: Delete old user
config
delete system login user admin
commit
exit

Use the 'request system login' command to generate a password hash before committing, or paste an encrypted hash directly. Always commit changes and verify connectivity before deleting the old account.

Palo Alto Networks credential rotation

Palo Alto firewalls separate admin accounts from the system. Rotate admin credentials in the web UI or CLI, and always maintain at least one backup admin account.

! Step 1: Create new admin account
config
set mgt-config users admin-new phash <hashed-password>
commit
exit

! Step 2: Test login via web UI or SSH as admin-new
! If successful, proceed to step 3

! Step 3: Delete old admin account
config
delete mgt-config users admin
commit
exit

For Panorama-managed firewalls, perform credential changes on Panorama first, then push policies to managed devices. Test each device individually before removing the old account.

Fortinet FortiOS credential rotation

FortiOS uses local admin accounts and optional LDAP or RADIUS integration. Rotate local admin passwords using the same create-test-delete pattern.

! Step 1: Create new admin account
config system admin
edit admin-new
set password <new-password>
set accprofile "super_admin"
end

! Step 2: Test login as admin-new
! If successful, proceed to step 3

! Step 3: Delete old admin account
config system admin
delete admin
end

Post-rotation validation

Automation and best practices

For large networks, automate credential rotation using Ansible, Terraform, or your vendor's API. Store credentials in HashiCorp Vault, AWS Secrets Manager, or CyberArk, and rotate them on a fixed schedule (every 90 days is common). Always generate strong, unique passwords; avoid reusing credentials across devices. Use SSH keys for service accounts where possible, and rotate those keys quarterly.

Test your rotation procedure in a lab environment first. Elematron's free network tools and multi-vendor config generator can help you build and validate configurations before pushing to production.

Password Generator
Generate strong, compliant passwords for network devices in seconds
Open →
Practise this on today’s Daily Ops Drill — a free network task every day.
Open the app →
Free tools for this
More from the blog
Hardening the management plane: the ports to close firstRead →Writing least-privilege firewall rules without breaking the appRead →