g992 / flashforge-ad5m-5mpro-research

Hardware and software researches and upgrades for Flashforge adventurer M5/M5 PRO
65 stars 5 forks source link

Getting root Not Working #16

Closed pelegw closed 6 months ago

pelegw commented 6 months ago

Did anyone notice a change that the getting root method doesn't work anymore? A regular user is created as expected, however the password is not in /etc/shadow and in any case, if I try to modify uid and gid to 0 I can't login anymore. This is the flow: Password: ': No such file or directoryh Connection closed by foreign host.

pelegw commented 6 months ago

OK, this was really dumb but if you create the passwd file on windows, you may get CRLF as newline, while in linux it would be only LF. So the CR character is interpreted as part of the shell name and that's why the login fails. So problem solved, nothing to with changing the uid:gid.