0

I have a VPS, until now I used the default root user for SSH access and everything. For security reasons I'd like to use a different user for root, terminal access and sudo operations. So I created another user, gave him the sudo and every other perm.

The problem is that all the system files belongs to root. What happens if I set PermitRootLogin No for root? Those files wouldn't be editable by the new root user!

jmreicha
  • 790
  • 1
  • 16
  • 29
MultiformeIngegno
  • 1,687
  • 9
  • 26
  • 31
  • Why not try to log in as new user first, then use `sudo vim /path/to/the/system/file` to see what happens. – quanta Sep 20 '12 at 13:53

1 Answers1

1

When you will set

PermitRootLogin No

in sshd_config, all it do is that you will not be able to log in to server with root account but only with user account. After you will log in to server with user account you will have to switch to root user and edit all system files which belongs to root. You might what to set in sshd_config also users which are allowed to log in to server using SSH like this

AllowUsers user1,user2,...
panaroik
  • 832
  • 5
  • 12
  • So if I understood you correctly, I set PermitRootLogin No for 'root' user, than I login with the 'root' account (now "normal" user) and than I can edit the system files with that user. With the other user now root (let's name it "root2"), I will be able to run sudo operations and access the terminal but not edit system files owned by 'root'. Right? – MultiformeIngegno Sep 20 '12 at 14:35