2

I was trying to create a default configuration file for activemq with the command

sudo ./activemq setup [ /etc/default/activemq | /home/leo/.activemqrc ]`

Then recieved this message:

INFO: It's recommend to limit access to '/etc/default/activemq' to the priviledged user
INFO: (recommended: chown 'root':nogroup '/etc/default/activemq'; chmod 600 '/etc/default/activemq')

Then I changed the owner and permissions of both /etc/default/activemq and /home/leo/.activemqrc with

chown root:nogroup ~/activemqrc; chmod 600 ~/.activemqrc


Changing the permissions of ~/.activemqrc was undoubtedly a big mistake. I took a look at the permissions on each file and folder on my Home and it says:

The permissions of "Everything" could not be determined

I no longer can access the directories and files in home.


Following the answer from Permission denied on ~ even though owner listed as me I ran the following command:

find ~ -type d -exec chmod 750 \;

and got this output:

find: pred.c:1932: launch: Assertion `starting_desc >= 0' failed.

Is there any way to get back my default configurations?

EDIT

I then tried this:

sudo chown root:root ~/

got no output and then

sudo chmod -R  777 ~/

That pretty much solved my problem but for two files which returned

chmod: cannot access `/home/leo/.gvfs': Permission denied
chmod: cannot access `/home/leo/.config/google-chrome/.com.google.Chrome.Z07tM9': No    such file or directory.

THAT WAS JUST A BAD IDEA.

1

1 Answer 1

2

You first attempt to fix it was just missing '{}' but then you made things a lot worse...

There is hardly ever a reason for any file to have 777 permissions, and there is hardly even a good use case for the -R flag when using chmod, because we need directories to be executable in order to enter or stat them, but we rarely want all files to be executable.

First, chown your home directory. Logged in as yourself, run

sudo chown -R $USER: ~

If you have simply run something like

chmod 600 ~

Then revert it:

chmod 755 ~

However, if you have run something really ill-advised like (do not execute) chmod -R 777 ~, then fixing the permissions will be more tricky.

find is very helpful for this. Directory permissions in your home will vary, and could be 700, 775, 755 or 750. To err on the side of caution, I would do this:

find ~ -type d -exec chmod 700 '{}' +

So only you can access the directories. You could instead use 755 and then correct these modes:

chmod 700 ~/.local ~/.cache ~/.dbus ~/.thumbnails ~/.gconf ~/.thunderbird

Then files. You might have had some executable scripts in your home but in general files should not be executable. Most files in your home would probably have had 664 or 644 permission, but again to be safe you might want to go with

find ~ -type f -exec chmod 600 '{}' +

This makes it so only you can access the files and directories in your home. If you prefer, Use 644 instead, and then correct the mode of the Xauthority file and a few others:

chmod 600 ~/.Xauthority ~/.ICEauthority ~/.bash_history ~/.local/share/keyrings/* ~/.xsession-errors ~/.lesshst

If you want to be really thorough, you can install a fresh Ubuntu VM or check the permissions of ~ on another machine... something like

find ~ -type d -not -perm 700 -exec stat -c "%n %a" {} \; | tee dirperms

and

find ~ -type f -not -perm 600 -exec stat -c "%n %a" {} \; | tee fileperms

Will generate lists you can use to make corrections.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .