S
SirM
Guest
Hi All,
I have written a java web application that gets loaded in the Tomcat server. This server runs with the credentials of the tomcat user.
I would like my Web App to be able to manipulate my apache httpdocs directory. I could do this by setting the directory's permission to 777 in Plesk. Though that would mean that anybody who has an application running in the Tomcat server would be able to manipulate this directory. Next to that it would mean that all the files in the httpdocs that are created newly, would be owned by the tomcat user, this is not desired because if you FTP you will gets permission issues.
I found after many test that the best way to do this is by calling the sudo command and then do the desired actions. This because I have the credentials to manipulate the httpdocs directory for my website.
The problem is, when I invoke .exec("sudo -u <username> <command>"), no matter what I do in my program it will continually say that the password that I provide for the user is incorrect. Note that I have tested and made sure the user does exist, i.e. I can log in on FTP and I have seen the user in the passwd file. Next to that, if i do "finger <username>" I can see that the user has an uid and a gid
Are you able to tell me what is still going wrong.
Many thx for any help,
SirM
I have written a java web application that gets loaded in the Tomcat server. This server runs with the credentials of the tomcat user.
I would like my Web App to be able to manipulate my apache httpdocs directory. I could do this by setting the directory's permission to 777 in Plesk. Though that would mean that anybody who has an application running in the Tomcat server would be able to manipulate this directory. Next to that it would mean that all the files in the httpdocs that are created newly, would be owned by the tomcat user, this is not desired because if you FTP you will gets permission issues.
I found after many test that the best way to do this is by calling the sudo command and then do the desired actions. This because I have the credentials to manipulate the httpdocs directory for my website.
The problem is, when I invoke .exec("sudo -u <username> <command>"), no matter what I do in my program it will continually say that the password that I provide for the user is incorrect. Note that I have tested and made sure the user does exist, i.e. I can log in on FTP and I have seen the user in the passwd file. Next to that, if i do "finger <username>" I can see that the user has an uid and a gid
Are you able to tell me what is still going wrong.
Many thx for any help,
SirM
PHP:
test