Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question
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
up vote 1 down vote accepted

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,...
share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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