0

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
2
  • 3
    Have you checked permissions! Commented Oct 27, 2011 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
    Commented Oct 27, 2011 at 11:06

1 Answer 1

1

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.

2
  • 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
    Commented Oct 27, 2011 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 Commented Oct 27, 2011 at 12:03

You must log in to answer this question.