add a user to the sudoers linux为用户添加sudo权限
- font size decrease font size increase font size
用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.0008 | 413856 | {main}( ) | .../index.php:0 |
2 | 0.0957 | 4264304 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0957 | 4264304 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3320 | 11455360 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3330 | 11479640 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3341 | 11534968 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3345 | 11562368 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3463 | 11962000 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3463 | 11962000 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3605 | 12612704 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3605 | 12612704 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3668 | 12983744 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3695 | 13004112 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4797 | 15831480 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4797 | 15831480 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4839 | 16004416 | 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 1845 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.0008 | 413856 | {main}( ) | .../index.php:0 |
2 | 0.0957 | 4264304 | Joomla\CMS\Application\SiteApplication->execute( ) | .../index.php:49 |
3 | 0.0957 | 4264304 | Joomla\CMS\Application\SiteApplication->doExecute( ) | .../CMSApplication.php:196 |
4 | 0.3320 | 11455360 | Joomla\CMS\Application\SiteApplication->dispatch( ) | .../SiteApplication.php:233 |
5 | 0.3330 | 11479640 | Joomla\CMS\Component\ComponentHelper::renderComponent( ) | .../SiteApplication.php:194 |
6 | 0.3341 | 11534968 | Joomla\CMS\Component\ComponentHelper::executeComponent( ) | .../ComponentHelper.php:377 |
7 | 0.3345 | 11562368 | require_once( '/var/www/vhosts/shan.info/httpdocs/components/com_k2/k2.php' ) | .../ComponentHelper.php:402 |
8 | 0.3463 | 11962000 | K2ControllerItem->execute( ) | .../k2.php:64 |
9 | 0.3463 | 11962000 | K2ControllerItem->display( ) | .../BaseController.php:710 |
10 | 0.3605 | 12612704 | K2ControllerItem->display( ) | .../item.php:78 |
11 | 0.3605 | 12612704 | K2ControllerItem->display( ) | .../controller.php:19 |
12 | 0.3668 | 12983744 | Joomla\CMS\Cache\Controller\ViewController->get( ) | .../BaseController.php:663 |
13 | 0.3695 | 13004112 | K2ViewItem->display( ) | .../ViewController.php:102 |
14 | 0.4797 | 15831480 | K2ViewItem->display( ) | .../view.html.php:742 |
15 | 0.4797 | 15831480 | K2ViewItem->loadTemplate( ) | .../HtmlView.php:230 |
16 | 0.4839 | 16004416 | include( '/var/www/vhosts/shan.info/httpdocs/templates/gk_publisher/html/com_k2/templates/default/item.php' ) | .../HtmlView.php:701 |