Ask Your Question

How to disable SSH root access in Fedora 27 using the Terminal?

asked 2018-01-26 21:14:36 -0600

paranoid_security gravatar image

I just executed the command "rkhunter --check" and there's a warning telling me to disable remote root access, also known as Secure Shell root login. I managed to do this in previous versions of Fedora by changing a line in the config file /var/log/rkhunter/rkhunter.log from "#PermitRootLogin" to "PermitRootLogin". As of now, this doesn't have any effect on the warning issued by rkhunter. So, is this a flaw in rkhunter or a change in the source code of Fedora? Any type of help that fixes this issue is highly appreciated.

edit retag flag offensive close merge delete


/var/log/rkhunter/rkhunter.log does not sound like a config file, more like log file.

florian gravatar imageflorian ( 2018-01-27 00:03:29 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-01-27 00:23:58 -0600

Mordoc gravatar image

I think what you want is the following:

sudo vi /etc/ssh/sshd_conf

Change the line that reads PermitRootLogin yes to PermitRootLogin no and then restart ssh:

sudo systemctl restart sshd.service

If you don't have sudo access, su to root and run the commands without sudo in front of each.

edit flag offensive delete link more


For fedora 28, the configuration file is /etc/ssh/sshd_config

ThierryC gravatar imageThierryC ( 2018-09-10 01:52:02 -0600 )edit

Question Tools


Asked: 2018-01-26 21:14:36 -0600

Seen: 985 times

Last updated: Jan 27 '18