I accidentally run
sudo chmod 700 /bin && sudo chmod 700 /bin
Then I couldn't run sudo or any commands again please is there a solution?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityRunning
sudo chmod 700 /bin && sudo chmod 700 /bin
would only change the permissions on the /bin
directory itself, or if it’s a symlink, the directory it points to. This would make the contents of the directory inaccessible to non-root users, but the damage is limited.
You can recover by logging in as root, or booting into a rescue environment (both of these require knowing the root password), or booting from a rescue device, and then running
chmod 755 /bin
You don’t need to re-install.
/bin/*
. This is not what you said. However it may be what you intended, as the two commands are currently identical. Can you tell us what you intended.