Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally ran sudo chmod a+rx ~ on the system root rather than sudo chmod a+rx myfolder...

I ran
sudo chmod -R a+rX myfolder/public_html
then accidentally ran
sudo chmod a+rx ~
instead of sudo chmod a+rx myfolder

This quote is from a site I was using as a guide...

"The first command sets everything in your public_html directory to be readable and accessible by all users on the system. The second command sets your home directory to be the same way (though not all the files in it, like we did with public_html). Note that the "X" in the first command is capitalized."

In short, I'm not a permissions guru and have many users on our cloud server. I would like to set it back to something more secure so that our main ssh users are fine, but any ftp user won't exploit my terrible mistake.

Pardon my ignorance!

share|improve this question
What user where you logged in at the time you ran the command? That command would only change the current user's home folder permisions (not the files and folders inside it since you did not use -R), not the complete system... – Bruno Pereira May 23 '13 at 20:12
my personal user's account through ssh. – Seth May 23 '13 at 20:13
Read edit, since you did not use -R you actually only changed your user's home folder, not even the files and folders inside it. – Bruno Pereira May 23 '13 at 20:14
My ~ is not set to /home, only my login directory. ~ holds a bunch of hidden files for profiles. Would this matter that ~ isn't actually home? – Seth May 23 '13 at 20:18
@Seth are you saying that ~ isn't /home/your_user_name? – demure May 23 '13 at 20:23
up vote 0 down vote accepted

chmod go-wrx ~ or, if sudo caused it to change root's ~, sudo chmod go-wrx ~root. Note: if root isn't setup, and thus doesn't have a real home dir, don't use the second, as you may remove permissions from a communal area.

share|improve this answer
I ran it as sudo. What does that command actually do? Other than hopefully fix my issue haha – Seth May 23 '13 at 20:19
@Seth chmod changes permissions. The go means group and other. the -wrx means remove read, write and execute. – demure May 23 '13 at 20:22
Thank you for the explanation... and this won't affect myself or the other main users, only user groups that we have created? – Seth May 23 '13 at 20:31
The first, yes. If you need the second (as you haven't clarified whether your user's home or root's home was effected) may have issues if root doesn't have a real home dir – demure May 23 '13 at 20:34
I believe it was my root's home as I ran it as sudo, with a ~ directory already existing for hidden files and profiles – Seth May 23 '13 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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