Setpasswd command

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search

Wrtf (Talk | contribs)
(describe setpasswd briefly)
Next diff →

Revision as of 02:19, 12 May 2020

The setpasswd command recreates the /etc/passwd file so that the password to log into SSH/Telnet will match the password for the Web administration GUI.

usage: setpasswd (no arguments)

Usually this occurs automatically when the password is changed using the GUI or [setuserpasswd], so setpasswd is not needed. You can check by comparing the hashed password in the NVRAM setting to the /etc/passwd file:

root@DD-WRT:~# nvram get http_passwd 
$1$tmuJ6dMD$7dOhWGU3L8LzeMNyDmndg0
root@DD-WRT:~# cat /etc/passwd
root:$1$tmuJ6dMD$7dOhWGU3L8LzeMNyDmndg0:0:0:Root User,,,:/tmp/root:/bin/sh
reboot:$1$tmuJ6dMD$7dOhWGU3L8LzeMNyDmndg0:0:0:Root User,,,:/tmp/root:/sbin/reboot