Can't create directory, "permission denied" error

0

1

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

yyy i 777

Posted 2011-10-27T10:58:46.880

Reputation:

3Have you checked permissions! – Didier Trosset – 2011-10-27T11:00:01.833

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. – None – 2011-10-27T11:06:14.097

Answers

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.

Konstantin Yovkov

Posted 2011-10-27T10:58:46.880

Reputation: 111

I am not a admin user , how can i add user to the owner group of the /home/tomcat/hwweb-1/webapps/ directory – None – 2011-10-27T11:12:01.407

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.

http://www.dba-oracle.com/linux/change_user_ownership.htm

– Konstantin Yovkov – 2011-10-27T12:03:21.397