Operating System - Linux
1828233 Members
2230 Online
109975 Solutions
New Discussion

RH 7.1 cannot open session

 
SOLVED
Go to solution
lastgreatone
Regular Advisor

RH 7.1 cannot open session

I'm not sure what happened, I may have corrupted the /etc/passwd. When I create a new user, via gui, it returns with no shadow created for that user. From the gui or cmd line, I try to su as root to the user, and returns with cannot open session. And the hostname is no longer linked to the username at the prompt, it shows as I have no name!@xxxxx.username$. Any clues?
7 REPLIES 7
Jeffrey Wong
Advisor

Re: RH 7.1 cannot open session

Try manually checking the entry in /etc/passwd for that account. It should look like the following if you are using shadow passwords:

login_name:x:uid_number:gid_number:user_name:user_home_directory:user_shell

Depending on what program was used to create the entry, user_name is sometimes blank.
Mark Fenton
Esteemed Contributor

Re: RH 7.1 cannot open session

Frankie, that sounds WIERD!

I suppose, if the user entry is messed up, su-ing to that user will yield peculiar results. Try this:

From the command line as root create a new user:

# useradd user1
#
user1 is created with no passwd, a default directory /home/user1 and shell of /bin/bash

verify this:

# grep user1 /etc/passwd
user1:x:520:520::/home/user1:/bin/bash
#

change user1's passwd

# passwd user1
Changing password for user user1
New password:
Retype new password:
passwd: all authentication tokens updated successfully
#

now su to user1

does this procedure work? If so, you may only have to remove the one user (or two that didn't get created correctly.

hth
lastgreatone
Regular Advisor

Re: RH 7.1 cannot open session

All entries check out ok.
Tried test with adduser. The result is the same. Either from the gui or console, as root I su to username and it returns with 'could not open session'. Do I have to tweak the /etc/securetty? Or how about the /etc/pam.d/su, how should it look like?
lastgreatone
Regular Advisor

Re: RH 7.1 cannot open session

One more point: I login as the new user I just created, and the prompt is still:
I have no name@xxxxx.username. I run whoami and it returns with "cannot find username for UID 1010.
Mark Fenton
Esteemed Contributor
Solution

Re: RH 7.1 cannot open session

Quite a challenge.

Could you include the screen output from your su username attempt?

Some other thoughts -- are you running a stock RH 7.1 kernel (i.e. no security enhancements from third parties like LIDS) ? Do you use NIS in this environment?

Beyond root, are there ANY valid user accounts on the system? (can you su to any of these?)

Does /etc/shadow exist? (with proper permissions -- Read for root only owner root/root.)

lastgreatone
Regular Advisor

Re: RH 7.1 cannot open session

Yes, using stock RH 7.1.
No NIS.
Cannot su to any other acct.
/etc/shadow with proper permissions, but may not be in sync with /etc/passwd, how do I resolve this?
Mark Fenton
Esteemed Contributor

Re: RH 7.1 cannot open session

Frankie, I'm not giving up on this, but if you can, let's try another tack:

If you have, or can install webmin, use the add new user option to create a new user account. Then see if that new account behaves normally.

I've seen instances where passwd gets messed up and cannot properly encrypt a passwd, perhaps it's having other issues on your system.

Another idea -- Manually create a password entry:

/usr/sbin/vipw

user1:x:1010:1010:This is a dummy account for user1:/home/user1:/bin/bash

:x!

then edit /etc/shadow (should automatically pop up)

user1:!!:11717:0:99999:7:::

:x!
again and then test
# su - user1

Copy your screen output (clean it up if you like) and post here if there're still problems.