0

I am configuring my server to prevent hacker bruteforce attacks by disabling root login from ssh: by setting PermitRootLogin no in file /etc/ssh/sshd_config.

This way I created new user (let's call it user) with secret name. But when I am changing file etc/passwd by setting user's GID and UID to root's "0" value, it is not possible to log in (due sshd_config).

But how can I make user root-like but keep safe ssh logining?

Egor
  • 211
  • What is your system version? (lsb_release -a)? – vanadium Jul 15 '22 at 18:09
  • you log in and use sudo program or sudo -i or you log in and use su user – AlexOnLinux Jul 15 '22 at 18:37
  • @Nmath no. This is not the case. I don't want to write SUDO at all. – Egor Jul 16 '22 at 03:59
  • @vanadium Operating System: CentOS Linux 8 || CPE OS Name: cpe:/o:centos:centos:8 || Kernel: Linux 4.18.0-348.7.1.el8_5.x86_64 || Architecture: x86-64. – Egor Jul 16 '22 at 04:36
  • @AlexOnLinux is it possible to not use sudo everywhere? I cannot even use sudo in WinSCP – Egor Jul 16 '22 at 04:38
  • CentOS is off-topic. We only support official Ubuntu. CentOS has little in common with Ubuntu. CentOS 8 is also an EOL system and is not considered safe to use. It's a bit strange to ask a question about improving security while using an EOL OS... You can ask about CentOS on Unix & Linux. That being said, I don't understand why you can't use sudo. You're absolutely right to disable root login, but you will need to give another user admin privileges.That's the purpose of sudoers – Nmath Jul 16 '22 at 05:30

0 Answers0