Unable to login to the Centos 7 2009 VM after waagent installation with selinux enabled.
ankitbaluni123 opened this issue · 2 comments
I am currently attaching the centos 7.9 disk to Ubuntu 22 VM as data disk and applying the changes to the disk using chroot command. And creating azure VM afterwards.
https://learn.microsoft.com/en-us/azure/virtual-machines/linux/create-upload-ubuntu
Working Scenarios:
In case when waagent installation is not done: Login works fine.
In case we are installing waagent but selinux is disabled: Login works fine.
Not Working Scenario:
But in case when selinux is enabled and we install waagent, I am facing login issue.
localhost login: shamish
Password:
Last login: Thu Jun 8 09:46:13 on ttyS0
-- shamish: no shell: Permission denied
I tried to start VM with SELinux turned off by using serial console. After doing this (adding selinux=0), the login works fine afterwards, even after enabling the selinux [ even in subsequent boots also].
https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/linux-selinux-troubleshooting
CentOS Linux 7 (Core)
Kernel 3.10.0-1160.90.1.el7.x86_64 on an x86_64
Image used to create the VM: CentOS-7-x86_64-Minimal-2009.iso (http://linux-mirrors.fnal.gov/linux/centos/7.9.2009/isos/x86_64/)
Azure VM Specification:
VM generation: V2
VM architecture: x64
Agent status: Ready
Agent version: 2.9.1.1
Are there any config changes done by waagent that might be causing this issue ?
We're not aware of any config changes that could cause this issue. We may look into a similar selinux setup in the further future.
If you can debug why login is failing, we may be able to spot what the agent is doing on that area
@maddieford , Have you verified/seen any case in which waagent installation is done during chroot (attached to Ubuntu environment)
and selinux was enabled , causing this issue ?