Deleted /home Restore partly works. Can't log in

I made a boneheaded mistake and hard deleted /home. My restore was fairly old so now all of my initializations don’t work and I can’t log into my existing user account.

I tried to remove .kde but I still l have the problem. I tried logging into KDE as root, and it worked. (I know…)

I tried creating a new user and it failed, which leads me to believe that some default initialization is broken.

Any thoughts on how to repair it?

That is very vague. Please tell us what happens as we can not look over your shoulder.

Can you login from a Virtual Terminal (e.g. CTRL+ALT+F4)?
Login as root and look at

ll /home
cat /etc/passwd | grep <insert your username here>

and if possible post the result here.

Sorry.
When i attempt to log into my account, mthe screen goes from the login screen to blank, stays that way for about a second and then the login screen reappears. The same thing happens if i create a new user. For some reason, root is able to log in and operate.

When i created new users, the usernames were shown on the KDE login window.

I dont have an easy way of logging in from a virtual terminal. It would be interesting to log in from the root account as my account. I think that would answer the question.

I was able to log using “su” from the working root account.

Posting from my system is not possible.

ll /home shows all of the users and their rights.
The listing of passwd shows values that would be expected username, x, user number, home directory and /bin/bash

???
Just issue CTRL+ALT+F4
at the login: prompt enter your username (usually all lowercase letters), then your password.
Does login succeed or not?

Depending on the age of your system “their rights” should be one of the following:

bruno@LT-B:~> ll /home/
total 36
drwxr-xr-x. 66 bruno     users      4096 giu 23 19:54 bruno
drwx------. 17 orsobruno orsobruno  4096 giu  8 19:07 orsobruno
bruno@LT-B:~>

Anything else might be the reason of a failing login, so check carefully.

Again, depending on the way you created the user accounts the details should reflect one of the following:

bruno@LT-B:~> cat /etc/passwd | grep bruno
bruno:x:1000:100:Bruno:/home/bruno:/bin/bash
orsobruno:x:1001:1001:OrsoBruno:/home/orsobruno:/bin/bash
bruno@LT-B:~>

And if everything goes the wrong way you can still post a photo of the screen with the results.

Ctrl+ALT+F4 doesn’t work. I am in KDE as root. I did the command and nothing happened.

My users don’t look different from yours.

I finally figured out that I was to type Ctrl+ALT+F4 from the login screen . This worked, but the home directory was set to “/”

This suggests that there is a problem with the home directory. Either it does not exist, or it has bad permissions.

I agree.

The funny thing is that I can “cd ~jc” and it works. Also to /home.

The protections on /home are drwxr-xr-x

And what are the protections on “~jc”?

The protections on ~jc are “drwxr-wrwx”

That looks wrong. Please recheck.

I changed the protections on /home to “drwxr-xr-x” I was able to log in, but I only saw a cursor on a black screen.

That is some progress, but not much.

Blockquote nrickertGlobal Moderator

3min

That looks wrong. Please recheck.

Blockquote
It is what I typed in. What should it be?

You previously said: The protections on ~jc are “drwxr-wrwx”

However, that second “w” is where there might be an “x” but not a “w”.

Please pay attention to details.
Your users are created according to the current (AKA “new”) default, for instance:

jc:x:1000:1000:John Cox:/home/jc:/bin/bash

but permissions for /home/jc are shown as drwxr-xr-x which is according to the “old” default.
The same applies to user jc1while user jc2and its /home/jc2apparently were created fresh on the system according to the current “new” standard.
So apparently /home/jc/and /home/jc1 were restored from an old system that used the “old” default permissions or they were restored the wrong way by non-standard procedures, or again you fiddled with permissions in a way that scrambled the normal configuration.
So not a surprise if users jc and jc1 cannot log in the usual way, but user jc2 should be able to login to the graphical session, or at least on a VT via CTRL+ALT+F4. Well, unless you fiddled with the permissions of the whole /home/directory.

(Apparently we live in distant time zones, so I might not be able to help you effectively on the details)