centos 6.10 cannot log in after installation

General support questions
Post Reply
Shaggy1
Posts: 26
Joined: 2014/10/19 10:51:11

centos 6.10 cannot log in after installation

Post by Shaggy1 » 2019/05/09 15:48:10

Hi

I've been attempting to install centos 6.10 on a DELL poweredge R610 via pxeboot using CentOS-6.10-x86_64-bin-DVD1.iso

The installation goes through fine (I am selecting Minimal install), but during it I only get asked for the root password, there does not appear to be any option to create a user.

When I get to the login prompt at the end of the install I try to log in as root, but it will not let me (probably because it is configured as no login ?). I cannot log in from a another machine via ssh either.

Does anyone know either how I can configure a user during the install so I can log in when the install is complete or whether there is a default login I can use ?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: centos 6.10 cannot log in after installation

Post by TrevorH » 2019/05/09 17:11:51

If you are using a Dell iDRAC to login then be aware that it will be set up to use a US keyboard so if you have any special characters in your password, if for example you really have a UK keyboard, then those will not match the keys on the US key layout. There's an option there somewhere to shift it to a different keyboard layout. Try typing the password at the user prompt so that it is visible and you can then verify that what you think you are typing is really what is being input. Just don't press enter with the password as the username :)

The root user is not nologin (at least not out of the box) so you should be able to login.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Shaggy1
Posts: 26
Joined: 2014/10/19 10:51:11

Re: centos 6.10 cannot log in after installation

Post by Shaggy1 » 2019/05/10 08:08:01

Thank you for the reply

Indeed checking the keyboard mapping is a good point and since I do have a uk keyboard I sometimes do get this problem.

However in this case it does not seem to be the issue.
When I type in an incorrect password I get the message:
'Login Failed'

When I type in the correct password it simply flips directly back to the login prompt.

When I try to ssh in from another machine I get the following message:
Unable to get valid context for root
Last login: Fri May 10 10:03:37 2019
Connection to xx.xx.xx.xx closed.

I have not yet tried going in to single user mode.

Shaggy1
Posts: 26
Joined: 2014/10/19 10:51:11

Re: centos 6.10 cannot log in after installation

Post by Shaggy1 » 2019/05/10 08:26:55

Quick update:

I can boot in to single user mode ok.
root user is not set as 'nologin', so should be able to login from console
It looks like ssh is configured to not allow root login, so it's not surprising I can get in via ssh

Now I can get in as single use can anyone suggest where I might look to find any other means/configuration that might be blocking login ? pam? selinux?

Shaggy1
Posts: 26
Joined: 2014/10/19 10:51:11

Re: centos 6.10 cannot log in after installation

Post by Shaggy1 » 2019/05/10 10:20:25

Further update:

If I disabled selinux I can login both at the console and via ssh.
My original selinux config looked like this:
cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
and I disabled it by setting SELINUX=disabled

in order to try to get some information about why the block I then set SELINUX=permissive to see if that said anything, but it didn't - I just logged in successfully.

Then I reset SELINUX=enforcing in the hope I could get some information from the logs, but to my surprise I could now log in successfully even with selinux enabled.

Looking at the earliest entries /var/log/secure I see messages as shown below it looks like at least some of the ssh login failures are still there:

May 10 09:43:37 lb-cam-bca-kstest login: ROOT LOGIN ON tty1
May 10 09:43:37 lb-cam-bca-kstest login: pam_unix(login:session): session closed for user root
May 10 09:43:47 lb-cam-bca-kstest login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
May 10 09:43:47 lb-cam-bca-kstest login: ROOT LOGIN ON tty1
May 10 09:43:47 lb-cam-bca-kstest login: pam_unix(login:session): session closed for user root
May 10 09:48:44 lb-cam-bca-kstest sshd[7283]: Connection closed by 10.168.6.139
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: Accepted password for root from 10.168.6.139 port 54123 ssh2
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: pam_selinux(sshd:session): Security context unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023 is not allowed for unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: pam_selinux(sshd:session): Unable to get valid context for root
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: pam_unix(sshd:session): session opened for user root by (uid=0)
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: error: PAM: pam_open_session(): Authentication failure
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument
May 10 09:49:25 lb-cam-bca-kstest sshd[7284]: Received disconnect from 10.168.6.139: 11: disconnected by user
May 10 09:50:07 lb-cam-bca-kstest unix_chkpwd[7291]: password check failed for user (root)
May 10 09:50:07 lb-cam-bca-kstest sshd[7289]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=lb-cam-bca-12.cam.broadcom.com user=root
May 10 09:50:09 lb-cam-bca-kstest sshd[7289]: Failed password for root from 10.168.6.139 port 54125 ssh2
May 10 09:50:14 lb-cam-bca-kstest sshd[7290]: Connection closed by 10.168.6.139
May 10 09:50:19 lb-cam-bca-kstest unix_chkpwd[7294]: password check failed for user (root)
May 10 09:50:19 lb-cam-bca-kstest sshd[7292]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=lb-cam-bca-12.cam.broadcom.com user=root
May 10 09:50:21 lb-cam-bca-kstest sshd[7292]: Failed password for root from 10.168.6.139 port 54126 ssh2
May 10 09:50:23 lb-cam-bca-kstest sshd[7293]: Connection closed by 10.168.6.139
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: Accepted password for root from 10.168.6.139 port 54128 ssh2
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: pam_selinux(sshd:session): Security context unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023 is not allowed for unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: pam_selinux(sshd:session): Unable to get valid context for root
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: pam_unix(sshd:session): session opened for user root by (uid=0)
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: error: PAM: pam_open_session(): Authentication failure
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument
May 10 09:50:40 lb-cam-bca-kstest sshd[7295]: Received disconnect from 10.168.6.139: 11: disconnected by user
May 10 10:03:37 lb-cam-bca-kstest login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
May 10 10:03:37 lb-cam-bca-kstest login: ROOT LOGIN ON tty1
May 10 10:03:37 lb-cam-bca-kstest login: pam_unix(login:session): session closed for user root
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: Accepted password for root from 10.168.6.139 port 54129 ssh2
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: pam_selinux(sshd:session): Security context unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023 is not allowed for unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: pam_selinux(sshd:session): Unable to get valid context for root
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: pam_unix(sshd:session): session opened for user root by (uid=0)
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: error: PAM: pam_open_session(): Authentication failure
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: Received disconnect from 10.168.6.139: 11: disconnected by user
May 10 10:12:38 lb-cam-bca-kstest sshd[7145]: Received signal 15; terminating.

The following lines look strange:

Shaggy1
Posts: 26
Joined: 2014/10/19 10:51:11

Re: centos 6.10 cannot log in after installation

Post by Shaggy1 » 2019/05/10 10:23:05

Sorry - accidentally posted before I had finished:

The following lines look strange:
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: pam_selinux(sshd:session): Security context unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023 is not allowed for unconfined_u:system_r:prelink_mask_t:s0-s0:c0.c1023
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: pam_selinux(sshd:session): Unable to get valid context for root
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: pam_unix(sshd:session): session opened for user root by (uid=0)
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: error: PAM: pam_open_session(): Authentication failure
May 10 10:04:21 lb-cam-bca-kstest sshd[7305]: error: ssh_selinux_setup_pty: security_compute_relabel: Invalid argument

Can anyone deduce from these errors what the problem might have been ?
Anyone know what is security_compute_relabel means ?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: centos 6.10 cannot log in after installation

Post by TrevorH » 2019/05/10 14:47:55

If this happened directly after the install then I suggest you start over as things do not look right there.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Shaggy1
Posts: 26
Joined: 2014/10/19 10:51:11

Re: centos 6.10 cannot log in after installation

Post by Shaggy1 » 2019/05/14 10:52:25

This is repeatable and happens only when I install via pxeboot.

If I plug a USB install stick in to the r610 and install directly from that it does not happen.

Post Reply