root@OpenWrt:~# passwd
Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
It seems the maximum length is 8. If I try to set a password longer than 8, only first 8 characters is valid.
How can I set a longer password for root?
My openwrt version:
Linux OpenWrt 4.14.108 #0 SMP Wed Mar 27 21:59:03 2019 x86_64 GNU/Linux
This is certainly not a limitation of OpenWrt in general. I observe it neither on 18.06 or on 17.02 standard images, it must be with your specific OpenWrt build or your configuration.
@vgaetera already seems on the case to solve this, I don't want to sidetrack his efforts. But to avoid confusion or rumours regarding this rather touchy subject, I changed the thread title from "Why the maximum length of openwrt’s root password is 8?" to something that reflects that this is your specific problem, not OpenWrt's in general.
After I changed the above parameters, although I can set a password larger than 8 digits, it is still invalid because the real password is only the first eight digits. I don't know if this is my problem.
My final solution is to set
# ENCRYPT_METHOD DES
to
ENCRYPT_METHOD MD5
in /etc/login.defs .
Now, I can finally set a root password that is really larger than eight.