I ran the chown command in a directory:
chown -R user:user {.,}*
The {.,}*
is used with mv
and cp
to include both hidden and listed files. Now this command went through and changed those two files in my directory, but I had to break it to stop since it went on. Now I'm afraid it has gone and changed the permissions on other files and folders, since it didn't terminate.
By using
{.,}*
, you included both./
and../
. Along with the-R
option, yourchown
call was about to browse your entire filesystem (and others, possibly mounted), going through../
. With other commands, this little mistake can be quite deadly, but believe me, you're not the first, and you won't be the last...Since this operation is quite heavy, your
chown
call hanged a while, as it had a lot of files to process. I'd suggest you go back to the directory where you made the call, and go back progressively to/
to see what changes were made. You might be able to apply a quick fix doing:On Ubuntu, the
/home
directory is given to the first (admin/sudo) user registered on the system. If you're the only user, you might want to do:However, a simple
chmod 755
on/home
is enough, even if it belongs to root.Having a quick look directly at
/
(including the root permissions themselves,ls -ld /
) would also be a nice place to start. I suggest you make sure that/
belongs to root, with a 755 permissions set.If you used
chown
to set a very specific ownership (a user other than you or root, a rare group, ...), you may want to usefind
to look forchown
-ed files.Unfortunately, there is no such thing as
undo
for what your did. Linux doesn't naturally keep tracks of these "casual" operations.For more information on what you were trying to achieve, have a look at this SuperUser question.