Answer the question
In order to leave comments, you need to log in
Sudo - how to use the ability to specify the computer name (ip address / network address) on which the command is allowed to run?
Many people are familiar with the sudo program.
We all know that the entry: user1 HOST=(user2) command
Allows user1 to run the command (script, program) command with the rights of user2 on the computer with the name/ip address/network address HOST
Usually, system administrators do not use HOST and instead write the alias ALL .
So it became interesting and not obvious to me how to use this opportunity.
For example, there are computers Host-A and Host-B .
On Host-A , there is an entry in /etc/sudosers : user1 Host-B= ALL
It allows the user touser1 run any commands on Host-B as root .
Do I need to somehow configure the sudo program on Host-B to query the /etc/sudoers file from Host-A ?
Has anyone had to put this into practice?
Answer the question
In order to leave comments, you need to log in
This is necessary for those cases when you have the same sudoers on tens-hundreds-thousands of hosts.
sudo wakes up, thinks "yeah, I'm a host such and such". And it looks to see if this user is allowed to do this here.
Looks at hostname -f usually, emnip.
And one sudoers is easier to roll out through some kind of config management system.
If /etc lives on NFS, this is useful.
If on a local disk, then there is no need.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question