您的位置:首页 > 其它

How to get root access for other users with the visudo

2017-10-08 10:14 681 查看
If you are seeing  errors of "touch: cannot touch ‘/opt/apache-tomcat-7.0.81/logs/catalina.out’: Permission denied"  similarly, that is because your current account has no permission to access the logs directory under the tomcat path.

Here you need to execute the command of 

chmod a+rwx -R $CATALINA_HOME/logs
to get the permission to read/write/execute(+rwx)the all directory(-R); but often you cannot execute this command, because this command need the root access.

Here you can log in root or just use the sudo to execute the command with 5 minutes' root access.

You need to use the VIM to edit the sodo configuration with command below: 

visudo
locate at the 

##Allow root to run any commands anywhere
root ALL=(ALL) ALL
add "username ALL=(ALL)    ALL " after it.

Then you can execute the chmod command and get the all read/write/execute permission for the /logs directory.

And of course then you can execute the start command .

Thank you. contact me with email zhangweicalm@qq.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐