关于用户权限的小疑问

zxczxcvvvvv 2015-04-26 10:27:09
当我执行sudo命令时,显示:
xxx is not in the sudoers file. This incident will be reported.

我想要用root用户去修改配置文件,当我输入su -时,显示:
su: Authentication failure

感觉进入了一种死循环,不知从何下手。
...全文
166 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xml111 2015-04-27
  • 打赏
  • 举报
回复
你的root用户lock了吧 解锁:sudo passwd -u root 设置新密码:sudo passwd root
brookmill 2015-04-26
  • 打赏
  • 举报
回复
随便搜到的,没有验证过 How to fix “username is not in the sudoers file. This incident will be reported” Error In Ubuntu Reboot the computer. If Ubuntu is your primary and the only operating system in your computer, press the “Shift” button when it is booting up. This should make the Grub screen show up on your monitor. On the Grub screen, press the down button to the Recovery mode and press Enter. On the next screen, select “Check all file system (will exit read only mode)”. When you see the message “Finished, press Enter“, press Enter. Next, select “Drop to root shell prompt”. You will now be at the command line. Type: usermod -a -G root sysadmin Replace the username with your own login name. That’s it. Now type “exit” and select “Resume normal boot”. 到这里问题应该就已经解决了。下面的步骤好像是应急措施 Follow the Steps below if u messup With sudoers file Do the Steps Untill 3 sudo cp /etc/sudoers /etc/sudoers.backup sudo nano /etc/sudoers Check the following lines in the file # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d Next save the file using # wq! Net Change the permission to the sudoers file # chmod 440 /etc/sudoers Then Add your Username to the Sudo group usermod -a -G root sysadmin Exit the Shell and resume normal boot are restart ...
brookmill 2015-04-26
  • 打赏
  • 举报
回复
试试 sudo -s

19,612

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧