I used rsync -aiiP to copy the /etc from my old laptop to the /etc of my new laptop. After locking the screen and trying to log back in, my password no longer works. I rebooted but it gets stuck on the loading screen and my new user account never appears, instead I am entered into emergency mode where I can use root on the command line to navigate the filesystem.
I think the problem could be that I replaced /etc/shadow and /etc/passwd on the new system with the ones from the old system. The user account on my old system and new system are different.
How do I get access to my user account again and what caused this problem?
I'm thinking of freshly installing fedora 37 on a different laptop and then copying /etc to the broken laptop using root in emergency mode, but I don't know if there's a better way.
/etc"just like that", including network configurations, configured mount points, mail settings, host SSH keys and config files for other packages, and a number of other things. The best option would be to restore from backup./etcis highly dependent on installed packages and different systems mustn't be synchronized unless you're 100% sure you know what you're doing. This answer could help you: unix.stackexchange.com/a/731966/260833 only instead of/varyou should use/etc. Mountingvaris not necessary of course./etc, can you explain?restorecon -rv /etc4.reboot