This question already has an answer here:

Having another Linux system mounted on /sys2. AFAIK passwords are stored there in second file of /sys2/etc/shadow file.

I'd like to set new password there. How to generate hash, which I can put there into second filed of desired row?

Btw. Is there nowadays one standard way of hashing passwords across Linux systems? I've checked on my three setups with different distributions and for same passwords I have same hashes.


  • passwd -R /sys2 - option -R does not do the job for me. I do not have all mounts for chrooting. And system I mount is arm, and I mount it on x86.
  • passwd -r ... - I couldn't figure out how to use -r repository option to work for me.

marked as duplicate by Grzegorz Wierzowiecki, Satō Katsura, Mongrel, roaima, Tomasz Feb 4 '17 at 13:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


If you have root access on the running system (that has the /sys2 mount) then simply

chroot /sys2

And then run the passwd command for whatever user

passwd someuser

And it will let you change it as if you were running whatever system is mounted under /sys2

This of course assumes that CPU architecture isn't going to cause problems ...

Not the answer you're looking for? Browse other questions tagged or ask your own question.