开发者

Adding daemon/web app to Linux group?

开发者 https://www.devze.com 2023-01-28 09:42 出处:网络
Anyone know how to assign a daemon or web app to a *nix group? For example, let\'s say I have a web app, deployed/running either in a container like tomcat or as a jar, how can I 开发者_高级运维add it

Anyone know how to assign a daemon or web app to a *nix group? For example, let's say I have a web app, deployed/running either in a container like tomcat or as a jar, how can I 开发者_高级运维add it to a group?


Daemons usually run under self-named unprivileged users, so You may use standard adduser USER GROUP command. For instance, to add user tomcat6 to group www-data You could use:

adduser tomcat6 www-data


To learn for sure what user id runs your application use something like getUid() from com.sun.security.auth.module.UnixSystem. You should include this user int the desired group.

Most likely it is running under the same userid running the webserver/container (in debian-based systems its usualy www-data).

0

精彩评论

暂无评论...
验证码 换一张
取 消