Topic: How to embed roto pw in the OpenWrt Image?

I have a particular brand of OpenWrt (Carambola2) but I assume the solution should apply to all brands.
Where I can specify the root pw so it will be active directly after FW flash?

2 (edited by hnyman 2017-02-17 17:53:27)

Re: How to embed roto pw in the OpenWrt Image?

Change password first on a live router, then copy /etc/passwd and /etc/shadow to your build system.

Include those two files in the build as "custom files". In practice place them to files/etc directory.

https://wiki.openwrt.org/doc/howto/build#custom_files

Re: How to embed roto pw in the OpenWrt Image?

wow, that was a fast answer thanks. Should be simple as it seems

Re: How to embed roto pw in the OpenWrt Image?

Isn't the hash in /etc/shadow salted?

I know on regular Linuxes, when you use the same password across multiple devices, the hash is always different.

LEDE 17.01 RC2+ on D-Link DIR-860L B1 :: Netgear WNDR3700 v1 (2x) & v2 (1x) :: PC Engines APU2 :: Ubiquiti Unifi AC Pro (2x) :: TP-Link TL-WR1043ND v1 (1x) & v2 (4x) :: TL-WR841N (2x) :: LEDE trunk on Asus WL-500W (wl) :: OpenWrt Attitude Adjustment 12.09.1 on Asus WL-500G Deluxe

Re: How to embed roto pw in the OpenWrt Image?

Borromini, it is nonsense. It may differ if different hash algorithm is used. Why is it different?

6 (edited by Borromini 2017-02-19 11:11:02)

Re: How to embed roto pw in the OpenWrt Image?

Isn't that the whole point of salting?

LEDE 17.01 RC2+ on D-Link DIR-860L B1 :: Netgear WNDR3700 v1 (2x) & v2 (1x) :: PC Engines APU2 :: Ubiquiti Unifi AC Pro (2x) :: TP-Link TL-WR1043ND v1 (1x) & v2 (4x) :: TL-WR841N (2x) :: LEDE trunk on Asus WL-500W (wl) :: OpenWrt Attitude Adjustment 12.09.1 on Asus WL-500G Deluxe

Re: How to embed roto pw in the OpenWrt Image?

Borromini wrote:

Isn't the hash in /etc/shadow salted?

I know on regular Linuxes, when you use the same password across multiple devices, the hash is always different.

the salt is included in the password hash, format is $algorithm$salt$hash
that's why you can copy it across devices