Below you will find pages that utilize the taxonomy term “Sudo”
June 30, 2011
is not in the sudoers file. This incident will be reported的解决办法
"\u003cp\u003e\u003cstrong\u003e在一般用户下执行sudo命令提示xxx is not in the sudoers file. This incident will be reported.解决方法:\u003c/strong\u003e\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e$whereis sudoers\n/etc/sudoers\u003c/p\u003e\u003c/blockquote\u003e\n\u003cp\u003e有时候我们只需要执行一条root权限的命令也要su到root,是不是有些不方便?这时可以用sudo代替。默认新建的用户不在sudo组,需要编辑/etc/sudoers文件将用户加入,该文件只能使用visudo命令,\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003e首先需要切换到root, su – (注意有- ,这和su是不同的,在用命令”su”的时候只是切换到root,但没有把root的环境变量传过去,还是当前用乎的环境变量,用”su -“命令将环境变量也一起带过去,就象和root登录一样)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003e然后 visudo 或者 vim /etc/sudoers, visudo 这个和vi的用法一样,由于可能会有人不太熟悉vi,所以简要说一下步骤\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e移动光标,到一行 root ALL=(ALL) ALL 的下一行,添加一行\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eyour_user_name ALL=(ALL) ALL\u003c/p\u003e\u003c/blockquote\u003e\n\u003cp\u003e然后保存退出! …\u003c/p\u003e"