0

I'm trying to disable root login via the serial console in RHEL 6. Based on this link from redhat (https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Security_Guide/s2-wstation-privileges-noroot.html), it says to basically clear out the /etc/securetty file. So, I have done that, and it does disable root login. The problem is that it disables ALL login. I still need to access it with a non-root login. So, is there a way to disable root login via console, yet still be able to login with other users. For example, with ssh, you can modify the "PermitRootLogin yes/no" parameter to do this.

Thanks!

1

Do you mean disabling root password? So that you can't login with root either in a console or in UI (which is a terrible idea)?

There are plenty of question about that : disable root login on console

But the casual solution is:

sudo passwd -l root

This is RHEL compatible since it is a very basic and old command.

But be careful to have sudo rights on other user accounts or you won't be able to run commands with root credentials anymore.

  • No, the questioner really does mean what xe says in the question: preventing the root account from logging on from that terminal (or, in this case, any other). This is what the secure TTY mechanism mentioned in the question and the referenced instructions from RedHat is all about. – JdeBP May 19 '18 at 20:14
  • Yes, just want to prevent root from logging in, but allow all other accounts access. After following the instructions, I cannot login with any account, let alone root. – jonesy19 May 19 '18 at 20:30

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.