first question here!

I have a CentOS 7 virtual machine using SELinux in my job's local network in which I want to install OKD. The issue is that OKD requires SELinux to be enabled, and enabling it means getting kicked out from the machine, since everytime I try to SSH into it, I get a "/bin/bash: Permission denied" message.

Is there any way to configure the access to the machine via SSH so that I could connect to it, preferably with a non-root user, and then change into a root user once the connection has been established?

Thank you very much in advance!

  • 2
    Have you relabeled the filesystem after enabling SELinux? – bodgit Oct 28 '19 at 10:56
  • I did not... Is that a necessary step? – Javier Riera Chirivella Oct 28 '19 at 12:56
  • That's possibly why you're getting an error. I always have SELinux enabled and it's never stopped SSH from working, I've certainly never needed to resort to creating custom rules. IIRC you just need to do touch /.autorelabel before rebooting after enabling it. – bodgit Oct 28 '19 at 13:42

Not sure what is messed up in your environment, I would suggest you to go through this reference. So, per my understanding you need to find the correct policies for ssh and add it to make it work you can use audit2allow and sealert to dig more into issue, still need help paste your ssh related logs from audit.log in your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.