Celeb Glow
news | March 23, 2026

Update permissions on folder to let user scp file there?

I have a folder named "webapps" with the following permissions:

$ ls -al /opt/tomcat
$ drwxr-x--- 7 tomcat root 4096 Aug 15 22:06 webapps

I have a user which is part of the "tomcat" group:

$ groups
$ hamburgers sudo tomcat

When I try to scp a file from my local machine to the /webapps folder on my server, I get a permission denied error:

scp -r /mymachine/test.war hamburgers@123.123.123.123:"/opt/tomcat/webapps/test.war"
scp: /opt/tomcat/webapps/test.war: Permission denied

I thought since user "hamburgers" was part of the "tomcat" group, they'd be able to do this. I can scp the same way to other folders on the server.

How could I change the permissions to get this to work?

Thank you

1 Answer

At the moment the group owner is root, not tomcat, so being in the tomcat group won't help hamburgers.

Change the group ownership to the tomcat group

sudo chown -R :tomcat /opt/tomcat/webapps

The -R makes chown apply recursively to all the contents of the directory.

The group will need write permission too:

sudo chmod g+w /opt/tomcat/webapps

Or if you prefer octal :)

sudo chmod 770 /opt/tomcat/webapps
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy