Please don't change permissions in order to read root-owned files. In future, if you want to read a file you don't have access to, use sudo cat
or sudo less
or open a text editor with root permission. If you think you really need to change permissions for some reason, then first do research or ask a question about it. It's all too easy to break your system with chown
and chmod
.
Anyway, your user already had read permissions on that directory and all its contents. The /bin
directory has permissions 755
or rwxr-xr-x
, as do the vast majority of its contents. They can be read and executed by any user.
You removed the execution bits (644
= rw-r--r--
), making the files readable for all, writeable for root, and executable for no user.
When you remove the execute bits from a directory, you make it impossible to enter the directory, except for root.
When you remove the execute bits from a file, you make it impossible to execute the file, even for root.
The Bash program is located at /bin/bash
. You have made the directory it is in inaccessible, and you have made the binary file itself non-executable, so not even root can run it. chown
and chmod
are also in /bin
, so you can't even use another shell to run them, if you happen to have one that isn't in /bin
.
Reinstalling your system is the best way to be sure you've got everything right, but if you would like to try fixing it or you really want to avoid that, what you could do is boot from a live system (eg USB installation media or System Recovery), mount your root partition, and change the permissions from there. See terdon's answer here for the best method of doing this (replace /etc
with /bin
and use chmod
instead of chown
).