Visudo 不再工作,我该怎么办?
打开了 visudo
所以...我不小心通过输入vi visudo
,同时我也更喜欢 nano,所以我只是自然地按 ctrl+x 退出,然后没有立即意识到我是在vi中(是的,我很慢哈哈)并不断尝试:P...无论如何,我终于意识到并且有一段时间没有使用vi了,所以我认为:x会退出而不保存,但我想情况并非如此现在,当我尝试 visudo 时,我得到
-bash: /usr/sbin/visudo: 无法执行二进制文件
知道我能做些什么来解决这个问题吗?实际的 /etc/sudoers 文件很好,我可以打开它,它看起来很正常,没有发现任何问题。所以我猜这只是 visudo 文件。我可以更换它或什么吗?
哦,还有使用 Ubuntu 8.04 (Hardy)
So... I accidentally opened up visudo by typing
vi visudo
and at the same time I also prefer nano so I just naturally pressed ctrl+x to exit, then didn't realize right away that I was in vi (yes i'm slow haha) and kept trying :P... anyway, I finally realized and haven't used vi in a while so I thought that :x would exit without saving, but I guess thats not the case and now when I try to visudo I get
-bash: /usr/sbin/visudo: cannot execute binary file
Any idea what I can do to fix this? The actual /etc/sudoers file is fine, i can open it and it looks normal, dont see anything wrong with it. So I guess its just the visudo file. Can I replace it or something?
Oh, and using Ubuntu 8.04 (Hardy)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
visudo
只是一个没有内置配置的二进制文件,因此您可以安全地替换它。包含在sudo
包中,您可以通过键入以下内容重新安装:如果您想了解如何使用您偶然发现的编辑器,请尝试键入
如果您只关心如何退出vi / vim 不破坏任何东西,方法是输入
:q!
visudo
just a binary file with no built-in configurations, so you can safely replace it. Is included in thesudo
package, which you can reinstall by typing:And if you're inclined to learn how to use the editor you stumbled onto, try typing
If all you care to know is how to exit vi / vim without breaking anything, the way to do is to type
:q!
您只需输入
visudo
即可启动 visudo。如果您输入vi visudo
,那么您正在尝试使用 vi 编辑 visudo,我希望这不是您想要做的。 Visudo 旨在以安全的方式编辑某些配置文件。如果使用普通编辑器编辑文件,则可能会犯错误并将设置弄乱至不可恢复的状态。使用 visudo 与 sudoers 一样编辑文件。You can launch visudo simply by typing
visudo
. If you typevi visudo
, then you are trying to edit visudo with vi, which I hope is not what you are intending to do. Visudo is meant for editing certain configuration files in a safe manner. If you edit the files with an ordinary editor, you might might make mistakes and screw up the settings in an unrecoverable state. Use visudo to edit files like sudoers.