记录一次macos没有sudoers文件问题

问题:但我输入sudo visudo

bash 复制代码
sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: error initializing audit plugin sudoers_audit

解决: 此文件不存在

bash 复制代码
su root # 现在我能登录root
touch /etc/sudoers
vi /etc/sudoers

添加

vim 复制代码
# in sudoers
root ALL=(ALL) ALL
zz ALL=(ALL) ALL#zz是自己的用户名
%wheel ALL=(ALL) ALL

现在输入sudo visudo,然后输入密码

相关推荐
lingggggaaaa1 小时前
CS配合CrossC2插件,实现MacOS/Linux上线
linux·运维·笔记·安全·macos
无意feel21 小时前
MacOS 安装neofetch cmatrix lolcat
macos·数字雨·彩虹特效
KevinShi_BJ1 天前
MacOS 上安装 Docker 和启动 LangBot
macos
ricky_fan1 天前
(25年12月)claude code报错:might not be available in your country
macos·bash
james bid1 天前
MacBook Pro 2015 上 XUbuntu 24.04 启用 eGPU (GeForce GTX 1080 Ti) 和核显黑屏问题解决
linux·ubuntu·macos·cuda·egpu
私人珍藏库1 天前
[Mac] Mac风扇控制软件 iFan V1.1.1
macos
腾讯云qcloud07551 天前
腾讯位置商业授权iOS 轨迹SDK
macos·ios·cocoa
新手村领路人1 天前
MacOS Tahoe26.1自制定时休眠app
macos
2501_916007471 天前
没有 Mac,如何在 Windows 上架 iOS 应用?一套可落地的工程方案
android·macos·ios·小程序·uni-app·iphone·webview
乐之者v2 天前
mac操作快捷键命令
macos