Stone-Time / Flashforge-Adventure-5M-Pro-Klipper-SSH

12 stars 0 forks source link

How to use this mod but with a different password? #3

Open DougJoseph opened 7 months ago

DougJoseph commented 7 months ago

Hello and thanks for this! It works great!

I changed the root password with

passwd

But afterward, every time I log in it tells me that my password has expired, and to reset it, but each time I do it logs me out and when I log back in, the reset cycle loops endlessly.

So, I am thinking I could edit this mod so it works but with a different password from the start.

I found one place in "flashforge_init.sh" where a password could be edited in plain text, but that seems to be Wifi related instead of Linux root user related.

Thanks for any advice!

eduncan911 commented 4 months ago

The shadow file is basically the password file. You can see the encoded password there.

To answer your question, you don't. FF uses root and always tries to reset it. That shadow fior does have an "force reset on passwd change" option. So that might help.

Instead, you create your own username and password. And since FF doesn't know about your account, it's never touched. It's quite simple: copy the one file flashforge_init.sh, remove all lines and add just these to create your own account:

https://github.com/g992/flashforge-ad5m-5mpro-research/blob/main/upgrades/getting_root.md

If you want to continue using this older patch, which may only work on 2.4.5 and not 2.6.x (FF is closing things down, they are reading these messages), then you can try to edit the shadow file to add your own new user (along with an updated passwd). Then use the hack in the above link to gain root access.

DougJoseph commented 4 months ago

Thanks!