没有权限时在Mac或Linux上编辑sudoers文件 [英] Editing the sudoers file on Mac or Linux when you have no permissions

查看:375
本文介绍了没有权限时在Mac或Linux上编辑sudoers文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在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 rootprivileges) in order to use the visudo command and edit the sudoers file

这篇关于没有权限时在Mac或Linux上编辑sudoers文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆