How to get root access for other users with the visudo

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值