I accidentally ran a chmod 754 ./
when I was at the root directory on the server which runs Ubuntu 18.04.
Now I cannot use commands like sudo
or pkexec
, nor can I change anything. What should I do? Does it affect other user?
I accidentally ran a chmod 754 ./
when I was at the root directory on the server which runs Ubuntu 18.04.
Now I cannot use commands like sudo
or pkexec
, nor can I change anything. What should I do? Does it affect other user?
--recursive
nor the -R
argument to chmod
, i.e. the ONLY file/directory that you modified was /
.If you found this question and answer through a search engine and used the recursive (-R
or --recursive
) method, please go here!
I ran the exact command you posted in your question on a VM, and recovered it with (almost) no trouble at all.
Since you only modified one directory/file, the solution is simple: just change it back!
You actually don't need a Live CD to fix this. Ubuntu has a built-in recovery mode. These steps assume your computer started turned off.
(recovery mode)
.chmod 755 /
Enterreboot
EnterThat's it! Unless there were any other complications, your system is recovered.
chmod 754 ./
orchmod -r 754 ./
? The latter would be much more destructive while the former should be easy to recover from. – Nonny Moose Jun 27 '19 at 22:10