Setpasswd command

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 02:19, 12 May 2020 (edit)
Wrtf (Talk | contribs)
(describe setpasswd briefly)
← Previous diff
Revision as of 02:19, 12 May 2020 (edit) (undo)
Wrtf (Talk | contribs)
m (fix dat link)
Next diff →
Line 3: Line 3:
usage: '''setpasswd''' (no arguments) 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:+Usually this occurs automatically when the password is changed using the GUI or the [[setuserpasswd command]], 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 root@DD-WRT:~# nvram get http_passwd

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 the setuserpasswd command, 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