Group/Other permissions in home?

I accidentally entered

chmod -R go-rx .*

in my home directory (instead of the directory that I wanted).

**
Will this cause any trouble?**

How do I restore the permissions to defaults? *chmod -R go+rX ** would probably be unsafe as well, right? However, this is just my private laptop, but I do have a guest-account and ssh access enabled.

It might if you have things you want to share, or stuff you publish via Apache. They would become inaccessible. To set group and world permissions on directories only.

find $HOME -type d -print0 | xargs -0 chmod go+rx

Wouldn’t harm much as these files strting with a . (dot) are normaly config files for you alone.

In fact I have most (if not all) inside my $HOME set to go-rwx and my uask is set to 077.

Restoring to default is not possible, as there is no default. When they are created by some application (or directly by you) the tool asks for a setting of access bits, but these are modified by the umask ruling at that moment in time. Not something that can be recreated. Only could go to the last backup you made before the mishap (not realy a mishap, byt good security I would say) and see for every individual directory/file what it was.

Well, it actually touched all directories and files, not just the hidden ones, although I do not understand this.

Second, I have problems with Kate now. Many keyboard shortcuts don’t work anymore, such as Ctrl-S for saving and Shift-Insert. Kate complains about shortcut conflicts, but changing the shortcuts won’t help. Adding group read/write permissions seemed to fix it now, but this is strange - maybe it was just a coincidence.

You could run a check to see if there are any files inside your $HOME of which you are not the owner.

.* also matches ., the current directory. And more dangerously, …, the parent directory, but fortunately for you, you wouldn’t have permissions on /home. But it would be disaster if root did this.

Next time, use .[a-zA-Z]*

Thanks! This solves the mystery for me! :slight_smile:

It actually did change permissions in another home directory, of which I happen to be the owner: /home/media where I store shared media files (music, video, photos). From a previous discussion on this forum, the home directory seemed to be the best place for shared media, but I should better change the ownership to root.

I doubt if making root the owner of such profane data is a good idea.
I have created an extra user beside the people in the house for this. You can use that user for maintaning those shared files without either spoiling your own stuff or (more important) real system stuff.

Put that user in the same group as the people who are alowed to use that data and ajust group priviliges accordingly. When group members are allowed to add files, these files will then be owned by those users, which is not what you want (they contribute, but will not be the owners then).
I solved this with a cron job run by root that runs (every 5 mins) the script:

chmod -R ug+rw /home/wij/
find /home/wij/ -type d -exec chmod ug+x '{}' \;

Where *wij *is the user I am talking about. In your case the username media comes to mind.