- Mastering Linux Security and Hardening
- Donald A. Tevault
- 289字
- 2021-07-02 19:19:21
Method 2 – creating an entry in the sudo policy file
Okay, adding users to either the wheel group or the sudo group works great if you're either just working with a single machine or if you're deploying a sudo policy across a network that uses just one of these two admin groups. But what if you want to deploy a sudo policy across a network with a mixed group of both Red Hat and Ubuntu machines? Or what if you don't want to go around to each machine to add users to an admin group? Then, just create an entry in the sudo policy file. You can either create an entry for an inpidual user or create a user alias. If you do sudo visudo on your CentOS virtual machine, you'll see a commented-out example of a user alias:
# User_Alias ADMINS = jsmith, mikem
You can uncomment this line and add your own set of usernames, or you can just add a line with your own user alias. To give members of the user alias full sudo power, add another line that would look like this:
ADMINS ALL=(ALL) ALL
It's also possible to add a visudo entry for just a single user, and you might need to do that under very special circumstances. For example:
frank ALL=(ALL) ALL
But for ease of management, it's best to go with either a user group or a user alias.
The sudo policy file is the /etc/sudoers file. I always hesitate to tell students that because every once in a while I have a student try to edit it in a regular text editor. That doesn't work though, so please don't try it. Always edit sudoers with the command, sudo visudo.
- Extending Symfony2 Web Application Framework
- CTF實戰(zhàn):技術(shù)、解題與進階
- 數(shù)字身份與元宇宙信任治理
- 網(wǎng)絡空間攻防技術(shù)原理
- 黑客攻防技巧
- 網(wǎng)絡空間安全:管理者讀物
- Penetration Testing with Perl
- 數(shù)字安全藍皮書:本質(zhì)屬性與重要特征
- 黑客攻防與無線安全從新手到高手(超值版)
- 防火墻技術(shù)與應用(第2版)
- Testing and Securing Android Studio Applications
- 計算機網(wǎng)絡安全技術(shù)研究
- 黑客攻防與網(wǎng)絡安全從新手到高手(絕招篇)
- 互聯(lián)網(wǎng)企業(yè)安全高級指南
- 空間群組密鑰管理研究:基于自主的深空DTN密鑰管理