没有权限时在Mac或Linux上编辑sudoers文件 [英] Editing the sudoers file on Mac or Linux when you have no permissions
问题描述
我正在尝试在MacOS(或Linux)系统上安装某些软件,但由于我不是管理员,所以我没有权限.所以我尝试使用sudo
,它说我不在/etc/sudoers
文件中.我已经尝试编辑sudoers
文件,但是它不允许我进行操作,因此我对其进行了搜索".大家都说要使用visudo
来编辑文件.问题是,它甚至不允许我使用visudo
!当我输入"visudo"时,它只会说
visudo: /etc/sudoers: Permission denied
将感谢您的帮助.预先感谢!
我尝试切换用户,然后编辑sudoers文件,但仍然无法正常工作
您需要具有root
(或具有root
privileges)才能使用visudo
命令并编辑sudoers
文件>
I'm trying to install something on my MacOS (or Linux) system and I don't have permission because I'm not the admin. So I tried using sudo
and it says that I'm not in /etc/sudoers
file. I've tried editing the sudoers
file but it won't let me, so I "googled" it. Everybody says to use visudo
to edit the file. The problem is, it won't even let me use visudo
! When I type "visudo" it just says
visudo: /etc/sudoers: Permission denied
Would appreciate some help. Thanks in advance!
EDIT: I tried switching users and then editing the sudoers file but still didn't work
You need to be root
(or have root
privileges) in order to use the visudo
command and edit the sudoers
file
这篇关于没有权限时在Mac或Linux上编辑sudoers文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!