add a user to the sudoers linux为用户添加sudo权限
- font size decrease font size increase font size
- Print Email
用sudo时提示"xxx is not in the sudoers file. This incident will be reported.其中XXX是你的用户名,也就是你的用户名没有权限使用sudo,我们只要修改一下/etc/sudoers文件就行了。下面是修改方 法:
1)进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root用)
2)添加文件的写权限。也就是输入命令"chmod u+w /etc/sudoers"。
3)编辑/etc/sudoers文件。也就是输入命令"vim /etc/sudoers",输入"i"进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存(就是先按一 下Esc键,然后输入":wq")退出。
4)撤销文件的写权限。也就是输入命令"chmod u-w /etc/sudoers"。
( ! ) Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 169 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0011 | 412440 | {main}( ) | .../index.php:0 |
2 | 0.1135 | 4262360 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.1135 | 4262360 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3879 | 11453224 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3890 | 11477504 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3902 | 11532832 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3906 | 11560232 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.4049 | 11959864 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.4049 | 11959864 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.4198 | 12610568 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.4198 | 12610568 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.4262 | 12981608 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.4342 | 13001976 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.5925 | 15828784 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.5925 | 15828784 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.5982 | 16001720 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |
- Published in CentOS 6
- Read 1844 times
( ! ) Notice: Only variables should be assigned by reference in /var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php on line 478 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0011 | 412440 | {main}( ) | .../index.php:0 |
2 | 0.1135 | 4262360 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.1135 | 4262360 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3879 | 11453224 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3890 | 11477504 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3902 | 11532832 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3906 | 11560232 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.4049 | 11959864 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.4049 | 11959864 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.4198 | 12610568 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.4198 | 12610568 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.4262 | 12981608 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.4342 | 13001976 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.5925 | 15828784 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.5925 | 15828784 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.5982 | 16001720 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |