I am asking, because I generated a live CD using the hash from an existing /etc/shadow
, assuming I will then be able to login with the corresponding password, but apparently login fails.
Linux – Copy /etc/shadow to Another System and Login with Passwords
linuxpasswordshadow
Best Answer
It's possible if
/etc/shadow
is not overridden by other mechanisms (viaPAM
,nss
, etc.), and/etc/shadow
, and/etc/passwd
on the target system must be in sync with the injected/etc/shadow
.I hope I didn't forget anything. :)
The easier (and safer) way to do it is to use
vipw
to save credentials for the relevant users on the source system, then copy them on the target system