Hello. I’m new to Nethserver but I know CentOS. What is the recommended way to edit templates? I prefer to use sudo instead of logging in as root over SSH.
Is this the best way? I don’t see the reason for making a separate group if we already have the adm group.
I am also confused about why the sudoers template is located in /etc instead of under /etc/e-smith like all the rest.
and the first one begins with the usual warning like this so it looks like part of the template system:
# ================= DO NOT MODIFY THIS FILE =================
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at NethServer official site: https://www.nethserver.org
#
#
Also, inside /etc/e-smith/templates/etc/sudoers/ I have some different files:
@mrmarkuz thanks, that works. For now I am logged in as root, but I am still trying to understand how sudoers works here. I thought all templates are contained within /etc/e-smith/ but like I wrote above, I have sudoers template fragments in both places.
I think this one is a little more subtle in the way it’s built. Building /etc/sudoers doesn’t create a file of the same name, like most other templates.
I think some time ago only /etc/sudoers was used. Then it changed and one may put the files to /etc/sudoers.d. To migrate the old sudoers file it was moved to /etc/sudoers.d/10_nethserver via template.metadata.
It turns out I didn’t need to change sudoers at all. I just had to create a user in the command-line and add to the wheel group. Apparently the web GUI keeps a separate list of users and passwords, so you have to add users in both places. I didn’t find this anywhere in the documentation. If anyone else is stuck on this, the commands are like this:
With it you can define who is the owner of the file, the permission, and where to expand the file.
As I am alone to edit the template, I personally use root, but the best security strategy could be to disable root and use only a full sudo delegated user (like ubuntu does)