How to change admin password using CLI in SonicWall Firewall?

Description

To change the administrator username and password on SonicWall over Graphical User Interface (GUI) is How can I change the administrator password?.

The requirement is to change the username and/or password of the admin (superuser) over the command-line interface. This article assumes:

  1. You have admin access to SonicWall, in other words, you have the login credentials to the SonicWall firewall
  2. SSH access using any Terminal application like puTTY. If SSH is not enabled on any interface, you can use the Console port to connect and then use puTTY. How can I login to the appliance using the Command Line Interface (CLI)? KB will be useful.

If you would like to enable web-management (HTTP or HTTPS access of SonicWall over browser) from CLI: How can I configure web-management using CLI?

Resolution

One of the popular programs to use to access the SonicWall SSH shell is PuTTY. It is either SSH over a terminal application or Console port connection with the following properties and then use a terminal application.

  • Bits per second: 11520
  • Data bits: 8
  • Parity: None
  • Stop bits: 1
  • Flow control: None

NOTE: On Factory default settings, the default username is admin and the password is password 

The commands are the same for Gen7and Gen6 SonicWall firewalls.

Using username 'admin'.
Password:
 
admin@C0EAE45----> config
config(C0EAE45----)# admin
(config-administration)# admin name NewAdmin
(config-administration)# admin password old-password "password" new-password "Pa$$word123" confirm-password "Pa$$word123"
% Processing request...
% Status returned processing command:
    admin password old-password "password" new-password "Pa$$word123" confirm-password "Pa$$word123"
% Changes made.
(config-administration)# commit
% Applying changes...
% Status returned processing command:
    commit
% Changes made.

Image

With the above commands, the admin name is changed to NewAdmin and the password is changed to Pa$$word123

CAUTION: The changes are applied immediately, so please be sure to note down the new values.  

Related Articles

  • SonicOS 8.1.0 FAQ
    Read More
  • SonicWall GEN8 TZs and GEN8 NSas Settings Migration
    Read More
  • Getting started with SonicWall firewalls
    Read More
not finding your answers?