You are not logged in.

#1 2016-10-08 16:53:55

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

user and root passwords not accepted after restoring an rsync backup

I was going to try to set u an encrypted root on my arch server, before messing with anything I made a backup with rsync. I messed up royally setting up the encryption and restored everything with my rsync backup, I copied using cp -pdRx. I can no longer log in. not at the terminal or via ssh. I have no DE installed, I'm hooked up to a monitor and keyboard but I run my server as if it's headless and do almost all my work via ssh. I only have the monitor and keyboard in case I break my network access as I've been messing with our network....

I haven't changed either the root or user password since I set them originally, I'm guessing there is some sort of permission problem and that's why I can't log in. Is there some way to fix this or am I stuck starting over? I tried logging in many times, the first few thinking I had mistyped the password.

Offline

#2 2016-10-08 17:13:13

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,904
Website

Re: user and root passwords not accepted after restoring an rsync backup

I'm not sure why you would restore an rsync backup with cp; chances are cp didn't copy over extended attributes (I am assuming you copied these originally). Usually you just use the same rsync command you used to create the backup, but with with the source and destination reversed.

If that isn't an option for whatever reason, or you didn't copy over extended attributes in the backup originally, you're going to need to chroot in and run pacman -Qkk to identify which packages need fixing. Also check the journal and see what error is printed when the login fails.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2016-10-08 20:20:46

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: user and root passwords not accepted after restoring an rsync backup

I had searched around for a while last night trying to find out how to fix this and figured it'd be a while before I got any sort of answer from here on how to fix this so I bit the bullet and went to work reinstalling I still have copies of everything so once I get everything installed(which I've just about done) it'll just be a bit till I'm back to where I was. After copying some configs, changing a few settings, and making both rsync and dd backups I'll be ready to try again at an encrypted root.

Later on on another disk I'll try using rsync instead of cp-pdRx. I've used cp -pdRx in the past with no issue to restore from rsync, I used the same rsync command as always to make the backup.

Offline

#4 2016-10-09 07:42:36

seth
Member
Registered: 2012-09-03
Posts: 51,792

Re: user and root passwords not accepted after restoring an rsync backup

You're looking for "cp -ax", but "-x" might be the culprit here because of the encrypted root.
Though using rsync should be far less troublesome - don't you get tons of "file present, override?" conflicts? (afaiu you had a running system and just scrubbed your backup onto it)

Online

#5 2016-10-10 19:45:50

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: user and root passwords not accepted after restoring an rsync backup

I was writing a response to seth and and realized that I'm not sure of the order in which I tried the many different methods I used to restore my backup as I had tried a few times. I'm writing my best guess as to what I did throughout the day.

I was working from another machine, a laptop running Arch and had the disk I was restoring plugged into it externally and mounted manually. At the point of restoring I went back to zero, I wiped the disk, repartitioned(no encrypted anything at this point) and copied everything back with cp -pdRx. After the copy I edited my fstab to comment out the network drives that are supposed to mount at boot and edited my sshd_config to allow root login. I finished up and put the disk back into the machine it came from, booted, but couldn't log in.

After that I tried I pulled the disk and hooked it back up externally to the laptop I was using to perform the restore. I then tried rsync but it was failing with chown permission errors. At that point I was getting permission errors for nearly every file, was something like chown permission denied. I was trying to restore from a backup on my NAS, I had manually mounted the samba share because the way nautilus had it mounted I couldn't type the path into the terminal. I did some digging on google trying to figure out why this was happening, my searching made me realize I forgot I didn't have to mount the NAS's disk that I could use something like I would for scp. For my source for rsync I used user@server:/path/to/rsync/backup everything seemed to go well. I ran rsyn twice to make sure everything had properly copied and that there weren't any errors. I couldn't find any errors and assumed all was good, I replaced the disk back to the machine it came from and still wasn't able to log in.

After this, I know I wiped the disk and DD'd an image that was older than the rsync backup onto it. After the DD'ing the image( never tried to boot it) I think I tried to use cp -pdRx to restore my rsync backup since it was much more current than the DD backup, I don't believe that it booted. After that I wiped the disk again, restored the old image with DD(once again making the mistake of not even attempting to boot the image and log in..)  and tried to use rsync itself to restore the backup made with rsync. This time I booted but was presented with the same password denied error.

By that time I was so frustrated I wrote my original post here and called it a night. Next morning I went about doing a fresh install, I'm pretty sure my old DD backup itself would have worked, but with all I went through the night before I just wanted a fresh start... I got the list of packages I had installed from my rsync backup and the configs I had edited and was back up and running in a few hours. I made a fresh DD image soon as I was satisfied I was back to where I had started my work on encrypting the root.

I'd still love to know why my backup was failing to let me log in

I haven't had an OS installed to an encrypted drive since my HP Elitebook was new, HP had it loaded with security software, it was actually pretty awesome and I was glad I played with it instead of just assuming it was bloatware. I literally only had to make a password and click encrypt and reboot and my drive was encrypted and working. The biggest issue I had then was that there was no way to access the files on the encrypted drive other than from the Windows OS that had the software that encrypted the drive.

Offline

Board footer

Powered by FluxBB