I am executing the following command from my Linux machine.

cp -r hwweb-ws-5.0 /home/tomcat/hwweb-1/webapps/

It's displaying the following error:

cp: cannot create directory `/home/tomcat/hwweb-1/webapps/hwweb-ws-5.0': Permission denied
link|improve this question
3  
Have you checked permissions! – Didier Trosset Oct 27 '11 at 11:00
Most probably you'll need to check who's the owner of the folder by using "ls -l /home/tomcat/hwweb-1/webapps" and then switch to that user by using e.g. "su webapps". After that try copying the folder again and don't forget to switch back to your user by hitting "exit" in the command line. – Stas Oct 27 '11 at 11:06
feedback

migrated from stackoverflow.com Oct 27 '11 at 18:03

This question came from our site for professional and enthusiast programmers.

1 Answer

Try

sudo cp -r hwweb-ws-5.0 /home/tomcat/hwweb-1/webapps/

and then type your super user password. The other way is to change the owner or add your user to the owner group of the /home/tomcat/hwweb-1/webapps/ directory. Obviously, your user doens't have right to write in this directory now.

link|improve this answer
I am not a admin user , how can i add user to the owner group of the /home/tomcat/hwweb-1/webapps/ directory – yyy i 777 Oct 27 '11 at 11:12
As far as I know, you have to be admin user to change permissions on directories. The other way is to execute the copy operation via tomcat user (because the copying is made in the tomcat's home directory). I think this link might be useful to you. dba-oracle.com/linux/change_user_ownership.htm – kocko Oct 27 '11 at 12:03
feedback

Your Answer

 
or
required, but never shown