0条评论
还没有人评论过~
su与sudo的差别
xyzdeMacBook-Pro:linux xyz$ su - root
Password:
su: Sorry
xyzMacBook-Pro:linux xyz$ sudo visudo
Password:
xyzdeMacBook-Pro:sbin xyz$ sudo su - root
xyzdeMacBook-Pro:~ root# visudo
xyzdeMacBook-Pro:~ root# exit
logout
xyzdeMacBook-Pro:sbin xyz$ visudo
visudo: /etc/sudoers: Permission denied
xyzdeMacBook-Pro:sbin xyz$ sudo visudo
sudo权限配置
xyzdeMacBook-Pro:linux xyz$ sudo visudo
# 打开之后,定位到以下内容:
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
xyz ALL = (ALL) ALL
xyz ALL = (ALL) /sbin/reboot, /sbin/umount
xyz ALL = (ALL) NOPASSWD:ALL
xyzdeMacBook-Pro:sbin xyz$ groups
staff access_bpf everyone localaccounts _appserverusr admin _appserveradm _lpadmin com.apple.sharepoint.group.1 _appstore _lpoperator _developer _analyticsusers com.apple.access_ftp com.apple.access_screensharing com.apple.access_ssh