2

My servers are currently running a fresh install of Ubuntu 16.04 server, no direct nor indirect system changes have been made.

A folder/file is completely accessible when created, but if I use chmod to make the slightest change, I completely lose access to that folder, and the only way to access it is through root.

sudo chmod -r -777 will make the folder completely useless, and there is no way for me to access it.

5

By chmod -777 you set the access rights to --------- i.e. you remove all access rights. Try chmod 777 and your file or folder will be accessible again.

| improve this answer | |
  • 1
    Nicely caught :-) – Rinzwind Nov 26 '17 at 20:08
  • I can`t belive i missed that. Thank you so much! – Fleskets Hånd Nov 26 '17 at 20:14
  • 1
    Normally you should avoid 777 though. Rather go for e.g. 755 or 644 (depending on whether it should be executable/is a directory or not) to restrict write permissions for other users except the owner. – Byte Commander Nov 26 '17 at 21:25

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.