WebFaction
Community site: login faq

When I'm working within one of my application's directories that is in the webapps directory (Ex: /webapps/mysameappdirectory) I get the permissions denied message when I try to mv, rm, unzip, etc. I was reading in the document about the different permissions options, but I wasn't 100 percent sure which option would be the one I would want to change the permissions to what I need (and if it's even possible to change those permissions within those directories.)

asked 27 Nov '14, 04:59

jcorbind
1314
accept rate: 0%

edited 27 Nov '14, 11:29


You can generally reset permissions of all files and directories recursively from the current directory using these commands:

# First, navigate to the directory to reset
cd ~/webapps/mysameappdirectory

# Reset all directories to 755 and all regular files to 644
chmod -R 0755 .
chmod -R g-s .
chmod -R u-s .
chmod -R -t .
setfacl -R -b .
find . -type f -exec chmod 0644 "{}" \;

Blindly resetting permissions can be dangerous. If your application has a "start" script, for example, you probably want that to be executable ("755" permissions), so you'll need to then set executable permissions ("chmod a+x /path/to/file") on such files.

If you get a bunch of errors that look like this:

chmod: operation not permitted

Then that means the files you're changing are probably owned by one of your SSH users instead of the main account user. You can open a support ticket and we can chown the files back to your main user.

Hope that helps!

permanent link

answered 27 Nov '14, 07:25

ryans ♦♦
5.0k93360
accept rate: 43%

Yes that helps and that's why I asked first! Thank you sir! :-)

(27 Nov '14, 11:28) jcorbind

Also, I might need to change ownership for the ssh user that I assigned to that specific applications directory. I'm not too sure yet; I'll go through my linux essentials commands book and check when I get home from work. It's not mission critical right now and the sites are working fine.

(27 Nov '14, 14:48) jcorbind

Update: I checked the permissions on a couple of my app's directories. Things looked good so I didn't change a thing. Next, I logged into two of my SSH user accounts that tied to only those apps and tried re-running the various commands that didn't work the night before (mv, wget, etc.)and low and behold they worked!

I was exhausted at the time, so I chalk it up to user error on my part. lol Still your advice is rock solid especially while I looked through my linux commands book as a second source. Thanks again!

(28 Nov '14, 03:23) jcorbind
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×103
×64

question asked: 27 Nov '14, 04:59

question was seen: 3,508 times

last updated: 28 Nov '14, 03:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM