I am setting up a Debian server through DigitalOcean, which I initialized with a SSH-key. Currently I can log onto the server as root or as a user.

Normally when I do this type of configuration, I uncomment PermitRootLogin yes from /etc/ssh/ssh_config, and change it to PermitRootLogin no. This time, however, I saw a shorter ssh_config that contained no PermitRootLogin.

When I tried to add it in, vim's syntax highlighting didn't recognize it, and restarting sshd didn't have any effect. I looked at the man page for ssh_config and the keyword wasn't listed.

How do I prohibit logging in as root via SSH?

closed as off-topic by muru, Michael Homer, mosvy, X Tian, GAD3R Aug 6 at 11:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – muru, Michael Homer, mosvy, X Tian, GAD3R
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 5
    sshd_config, for the server, not ssh_config for the client. – muru Aug 6 at 2:27

The ssh_config file is the default configuration for SSH clients. The server configuration will be found in sshd_config. The PermitRootLogin is a server setting (it modifies the behaviour of the SSH server) that should go in the server configuration file.

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