koycloud / huhamhire-hosts

Automatically exported from code.google.com/p/huhamhire-hosts
GNU General Public License v3.0
1 stars 0 forks source link

最小权限原则优化 #86

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
在 Linux 
操作系统(其他操作系统亦可如此执行)上可以通过下面方��
�获得 /etc/hosts 文件的写入权限:

0. 进入 root 账户进行设置
1. groupadd hosts # 添加 `hosts` 组
2. chown root:hosts /etc/hosts # 将 `/etc/hosts` 设置为 `hosts` 组所有
3. chmod g+w /etc/hosts # 赋予 `/etc/hosts` 文件 “组可写” 模式
3. usermod -aG hosts <username> # 将当前用户加入 `hosts` 组

当前用户即可获得写入权限,此后不须对程序进行额外授权��
�

因此,希望能仅确认对 /etc/hosts 
的写入权限,而不是采用判断用户是否为 root/Administrator 
的方式进行权限提醒。

Original issue reported on code.google.com by ImAndr...@gmail.com on 14 Nov 2013 at 1:12

GoogleCodeExporter commented 9 years ago
Good point! 之前我也有收到用户关于在 SUSE 
上出现权限判断问题的反馈,下一版本会对这个问题做出改��
�

Original comment by hujunx...@gmail.com on 15 Nov 2013 at 1:02

GoogleCodeExporter commented 9 years ago
1.9.7 版本已提供新的解决方案

Original comment by hujunx...@gmail.com on 2 Dec 2013 at 8:42