Hacker News new | ask | show | jobs
by chanri 5578 days ago
What if you can't disable root login (i.e. it's a cloud server)?
4 comments

There's no reason you can't disable root logins on a cloud server. I do it every time.
This is where firewalls come in handy...

Disabling remote root login isn't as big a deal as it used to be - as others have said, if someone gets your administrative account you're pretty screwed anyway - and if they get your password for sudo, it's the same thing.

Other than that, it really depends on what you mean by cloud.

Restrict root login from a particular IP address

AllowUsers root@112.113.114.115

I use AllowUsers to ensure only users I want can login from SSH.

But what if your IP address changes?
Root login shouldn't be your normal entrance. For maintenance stuff use sudo-capable regular user account with public key authentication. If there's some software that requires root login and you cannot do anything about it, enable root login and allow it only from the specific IPs.
Why can't you disable root login on a cloud server?