19
votes

I am able to successfully connect to amazon ec2 instance using filezilla. The Username i used is ec2-user. So when i try to transfer my application war to tomcat it says

/var/lib/tomcat6/webapps/RealEstateERP.war: open for write: permission denied
 Error: File transfer failed.

I tried to change permission use filezilla but not allowed to do so. I know there is no write permission, but how do i change it.

I ma new to linux. Please help me.

1
Voted up. I had the exact same problem. Maybe it's off topic. Should it be on super user?user4951

1 Answers

34
votes

The ec2-user don't have permission to write files in /var/lib/tomcat6/webapps/. Only root user can do so. You have two ways here to do so:

1) Copy files to /home/ec2-user/ using filezilla. Now SSH into linux machine through putty. Change to root user using command sudo -s. Then copy file from /home/ec2-user to /var/lib/tomcat6/webapps/ using command cp -i RealEstateERP.war /var/lib/tomcat6/webapps/.

2) SSH into linux machine through putty.Change to root user using command sudo -s.Provide write permission to all users on /var/lib/tomcat6/webapps/ using command chmod 777 /var/lib/tomcat6/webapps/. Then copy files to directory directly from filezilla.