Centos cannot login by console or ssh session closed immediately

In my case I could login with the initial install but I rsync'd everything over while preserving ownership and permissions to another RAID partition and booted from that.was fine before. The problem is that you are kicked out the second you login and the problem was SELINUX for some reason (perhaps it noticed something strange when it was moved to the new partition)


login: pam_unix(login:session): session opened for user root by LOGIN(uid=0)
login: ROOT LOGIN ON tty1
pam_unix(login:session): session closed for user root

#in my case the issue was selinux so disable it

How to disable SELinux

 

Here were the error/denied messages in /var/log/audit/audit.log

 

type=AVC msg=audit(1445614919.831:12): avc:  denied  { entrypoint } for  pid=1072 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
type=AVC msg=audit(1445614924.074:22): avc:  denied  { entrypoint } for  pid=1077 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
type=AVC msg=audit(1445614943.809:38): avc:  denied  { entrypoint } for  pid=1088 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
type=AVC msg=audit(1445614969.449:48): avc:  denied  { entrypoint } for  pid=1093 comm="login" path="/bin/bash" dev=md2 ino=632 scontext=unconfined_u:system_r:abrt_helper_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:file_t:s0 tclass=file
 


Tags:

centos, login, console, ssh, immediatelyin, initial, install, rsync, preserving, ownership, permissions, raid, partition, booted, selinux, pam_unix, user, uid, tty, disable, var, audit, avc, msg, entrypoint, pid, comm, quot, bin, bash, dev, md, ino, scontext, unconfined_u, system_r, abrt_helper_t, tcontext, object_r, file_t, tclass,

Latest Articles

  • Bad Power Supply Issue Story Diagnosing Troubleshooting
  • Getting started with AI (Artificial Intelligence) in Linux / Ubuntu using by deploying LLM (Language Learing Models) using Ollama LLMA
  • microk8s kubernetes how to install OpenEBS
  • Flash LSI MegaRAID 2208 to IT mode in Linux Mint/Debian/Ubuntu
  • LSI MegaRAID in Linux Ubuntu / Centos Tutorial Setup Guide megacli
  • Convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/413. convert-im6.q16: no images defined `pts-time.jpg' @ error/convert.c/ConvertImageCommand/3258. solution ImageMagick P
  • Apache PHP sending expires header solution cannot use cache with CDN
  • How to install virt-manager in Mint 22/Ubuntu 22
  • Infiniband Guide
  • python mysql install error: /bin/sh: 1: mysql_config: not found /bin/sh: 1: mariadb_config: not found /bin/sh: 1: mysql_config: not found mysql_config --version
  • FreePBX 17 How To Add a Trunk
  • Docker Container Onboot Policy - How to make sure a container is always running
  • FreePBX 17 How To Add Phones / Extensions and Register
  • Warning: The driver descriptor says the physical block size is 2048 bytes, but Linux says it is 512 bytes. solution
  • Cisco How To Use a Third Party SIP Phone (eg. Avaya, 3CX)
  • Cisco Unified Communication Manager (CUCM) - How To Add Phones
  • pptp / pptpd not working in DD-WRT iptables / router
  • systemd-journald high memory usage solution
  • How to Install FreePBX 17 in Linux Debian Ubuntu Mint Guide
  • How To Install Cisco's CUCM (Cisco Unified Communication Manager) 12 Guide