Login problem after wrong answers to pacnew questions

Hello

I did something - not sure what, probably overwrote something I shouldn’t have - with pacnew and now I have a login problem :worried: :

When I boot my machine, I get to the splash screen, but my original username is not available and if I try writing my original username and password, it won’t go forward, it just clears the password prompt after a moment.

I even created an another user to the system, which now is offered by default, but it won’t accept the password and won’t let the new user login either.

I checked /etc/passwd and /etc/shadow - the former doesn’t show my original username but the latter has the pw hash for my original user.

In the course of trying to correct the mess I created, used the manjaro-chroot -a to get into the system and I deleted all the .pacnew files in the system, but I don’t know if that just caused more troubles…

I appreciate any help anyone can provide :green_heart:.

Hi, welcome back Pegleg…

Perhaps covering your tracks was not the best idea… You should perhaps pay attention to the news feeds whenever you backup (assuming you’ve been here longer than 2 years).

Snapshots

This is perhaps my favourite solution, as it avoids having to reveal stupid mistakes in the forum (and hopeully I’ll remember not to make them again).

Since using Linux Mint, I always made sure I had some kind of snapshot (using Timeshift mostly) to roll back and correct stupid mistakes (and I’ve made plenty of those).

I’m guessing you have no snapshots.

Detective work:

You will need to be very specific - what update, Stable, Testing, or Unstable. This might help someone sort out what kind of pacnew files they remember cropping up recently.

You should also read (you should have read before) the Update Thread:

:warning: Especially this part:

If you’ve loaded up any of those pacnew files, there might be some history in your ‘recent files’ or in your text editor’s history.

Search the Forum

Here’s one:

1 Like

Thanks Ben :slight_smile:

You have listed all the right actions I should have taken, and some of those I’ve already checked - yet I haven’t been successful in finding the key files.

The silver lining in this mess is that the machine I messed is my test/secondary unit, so no vital stuff in there…but it would still be fantastic if I find a way to recover without reinstalling.

2 Likes

It would. Sadly nobody else is coming along just yet (maybe give it 24 hours - there are plenty of ‘gurus’ hanging around the forums, I’m not one of those).

However, it might also be useful to create a backup (I use back-in-time for my data, alongside Timeshift for system snapshots… back-in-time creates snapshots on another disk/partition).

Reinstalling takes 5 minutes, then you can import configs etc.

Then, of course, you will not fail to set up Timeshift at the least :wink:

Live and learn. Fortunately, with Timeshift and back-in-time, my current installation followed a hardware failure nearly 3 years ago… before that I messed up a few times, but Timeshift always bailed me out.

1 Like

You have replaced /etc/passwd with the .pacnew file /etc/passwd.pacnew
instead of merging it.

Of course the generic .pacnew file doesn’t have your user account in it.

But it is relatively easy to correct.

Using manjaro-chroot is probably the easiest to describe:

  • boot the live system and chroot (manjaro-chroot -a) just as you did already

  • issue one simple command:
    cp /etc/passwd- /etc/passwd
    (note the - at the end of the first file name)

  • exit
    to exit chroot

  • reboot

The file /etc/passwd- is the backup copy of /etc/passwd - you overwrote the latter, the command reverses that, it copies the backup copy to the original, restoring it’s previous state.


Another way would be to simply set a new password for your user - in chroot you are root and can do that.


After that we can worry about all the other changes that the .pacnew files which you deleted would have contained.

4 Likes

Thank you so much for all the help :heart_eyes:! I was able to recover my machine with the following, which is a slightly modified version of what you @Nachlese suggested: I added my original user to the /etc/passwd file and that did it :partying_face:! It feels fantastic not to have to re-install.

Once more Thank You very much for your help @Ben and @Nachlese, you rock!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.