You are not logged in.

#1 2012-10-11 22:56:47

webstrand
Member
Registered: 2012-10-11
Posts: 6

[Solved] Unable to login

I was initially attempting to solve issues related to systemd not being able to open the system_bus socket in /var/run/dbus/system_bus. At some point I made a modification that has prevented me from logging in, with any username.
After logging into a tty with a username and password successfully, the tty doesn't print out anything more, my shell is never executed, and after about 30-60 seconds the tty is cleared and the login prompt is displayed once again.
/var/log/auth.log confirms that each time I try to login, I am successfully authenticated.

Oct 11 18:38:42 laptop login: pam_unix(login:session): session opened for user first by LOGIN(uid=0)

How can I make it so I can login again?

Last edited by webstrand (2012-10-12 14:32:08)

Offline

#2 2012-10-12 00:11:32

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Unable to login

Is this a trick question? 

webstrand wrote:

At some point I made a modification that has prevented me from logging in...

Are we supposed to guess the nature of your computer use?

Offline

#3 2012-10-12 02:22:42

webstrand
Member
Registered: 2012-10-11
Posts: 6

Re: [Solved] Unable to login

That was not my intent when I said that. I was trying to say that I have no idea what it was that got changed that caused my issue.

However I can say that I used vimdiff to merge in the following .pacnew:

/etc/group.pacnew
/etc/gshadow.pacnew
/etc/passwd.pacnew
/etc/protocols.pacnew
/etc/rc.conf.pacnew
/etc/services.pacnew
/etc/sysctl.conf.pacnew
/etc/pam.d/login.pacnew

I then used rmdir on /var/run and /var/lock and reinstalled filesystem.

I rebooted to see if systemd would connect to the system_bus socket properly, now that /var/run was a symlink, not an empty directory, but found that I could not login. I deduced that this was because I had removed my user from the /etc/passwd file.

I rebooted using init=/bin/sh and mount -o remount,rw / and restored my user to /etc/passwd from /etc/passwd-.

Upon reboot I found that I could not login. I rebooted again using init=/bin/sh and I reset the password on both my root and my account. I also created a new account to test with. Rebooting normally, I found that I still could not login.

Looking into the man pages, I found that agetty delegated login handling to /bin/login, and that login would print the contents of /etc/motd. I modified /etc/motd to contain something.

Upon rebooting and attempting to login again, I found that login did print the motd, which meant that I had been authenticated and that the problem was somewhere else, but that I still could not login.

Does that help? I'm still at a complete loss of what to do next.

Last edited by webstrand (2012-10-12 02:23:47)

Offline

#4 2012-10-12 02:27:15

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] Unable to login

Wait, you merged entries into group, passwd, and gshadow?  You do know that the User ID's and such in those files shouldn't be messed with once they are created? You have very likely upset your system's users and groups and passwords.  The lesson to learn here is do not blindly merge files, do them by hand every time.  Do you have backup files?  Every time a .pacnew file comes along backup the original file.  Don't just rename it and start anew because the original files permissions also need to be kept.  But the backup will let you restore any unfortunate changes.

Last edited by headkase (2012-10-12 02:28:36)

Offline

#5 2012-10-12 02:31:11

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Unable to login

I have used gentoo a couple of times in the past and have begun again, and one tool that I really like is etc-update.  There is a version in AUR that is ported to Arch.  It searches for pacnew files and lets you choose what to do with them.  I guess it is not that hard to do it manually, but it is just something I have gotten used to.

Offline

#6 2012-10-12 02:35:59

webstrand
Member
Registered: 2012-10-11
Posts: 6

Re: [Solved] Unable to login

I didn't blindly merge them, I used vimdiff to copy over the lines individually, or reorded the entries manually. The only reason my user was removed from /etc/passwd was because I was careless. Though I will make backups before I merge .pacnew files from now on.

Are these files the issue? I had thought I had corrected the error, because authentication still succeeds.

Offline

#7 2012-10-12 02:57:50

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [Solved] Unable to login

I honestly don't know the "right" way to fix your issue.  If I was able, I'd create a new user, mv all my old users files into the new folder and recursively chown the works.

Then see if system users and such still worked correctly.

Offline

#8 2012-10-12 03:09:23

webstrand
Member
Registered: 2012-10-11
Posts: 6

Re: [Solved] Unable to login

I already tried creating a new user, and couldn't login using that one either. How would I go about testing the system users?

Offline

#9 2012-10-12 14:31:56

webstrand
Member
Registered: 2012-10-11
Posts: 6

Re: [Solved] Unable to login

Well thank you for sending me down the right path. I was missing other users in my /etc/passwd file, and this was preventing me from logging in. I recovered a previous version of my /etc/passwd file by doing the following:

strings /dev/sda2 > strings_list
cat strings_list | grep -F -200 "first:x:" > search_results

The file search_results contained ~10 different versions of my /etc/passwd file. I simply selected the one that matched /etc/shadow and carefully merged the previous version into /etc/passwd.
I should note that /etc/shadow was undamaged througout this fiasco.

Last edited by webstrand (2012-10-13 02:03:23)

Offline

Board footer

Powered by FluxBB