##Running Commands on your Router using PuTTY
Most Routers use a Linux-type operating system, and you can issue commands to the Router through the shell command line using PuTTY or another Telnet or SSH client program.
The WiFi Password(s) are stored in your Router in variables in an area called NVRAM. We can read these variables, and set (overwrite) them with other values.
To see what is stored in NVRAM, issue the command:
nvram show
That command will output a lot of information that is very hard to sift through …
So to get a shorter list of variables, we can filter it. Most Routers store the WiFi passwords in similar variables such as:
// 2.4 GHz band, NVRAM variable for MAIN Network
wl0_wpa_psk
// 2.4 GHz band, NVRAM variables for Guest Networks 1-3
wl0.1_wpa_psk
wl0.2_wpa_psk
wl0.3_wpa_psk
// 5.0 GHz band, NVRAM variable for MAIN Network
wl1_wpa_psk
// 5.0 GHz band, NVRAM variables for Guest Networks 1-3
wl1.1_wpa_psk
wl1.2_wpa_psk
wl1.3_wpa_psk
We can filter the nvram show
command to list only the WiFi Network Password variables using grep
, and sort them alphabetically, as such:
nvram show | grep wl.*_wpa_psk | sort
If we just want to see all the WiFi Guest Network Password variables, we refine the filter as such:
nvram show | grep wl..._wpa_psk | sort
To set a new Password for a Network, use the the nvram set
command …
// set a new Password for 2.4 GHz band Guest Network 1
nvram set wl0.1_wpa_psk=newpassword
After setting any new Passwords, we need to “save” them using the nvram commit
command:
nvram commit
And finally, for the changes to take effect, we need to either restart the Wireless Service , or reboot the Router:
// restart wireless service (only available on certain firmware)
service restart_wireless
// reboot router (DD-WRT firmware requires reboot)
reboot