Understanding the/etc/sudoers file
We must make a special permissions entry for
/etc/sudoers in order to allow it special access:
packt ALL=(ALL) ALL
Let’s break down this line’s syntax:
- First, we state to which user this rule applies (
- All hosts that use the same
/etc/sudoersfile are covered by the rule if the first
ALLis present. Since the same file is no longer shared among different machines, this term now refers to the current host.
(ALL) ALLinforms us that any user may execute any command as the
packtuser. In terms of functionality, this is similar to
It is important to manage permissions using groups as it makes life much easier. Imagine how simple it would be to just remove a user from a
sudo group rather than removing the user from 100 different places.