0

There are lot of questions regarding the same mistake , What i did was :

chown -R root:www-data myfolder /

by mistake i typed a space between the folder & / . Then i was not able to do sudo any more . After following this link i was able to do sudo again . But my concern is will this going to break my system in the future ? would be there any issue in the future reboots ?

I still not closed the connected ssh as root . The server is used only as a webserver .

Shan
  • 103
  • 3
  • 2
    It's an issue already. I'd recommend to reinstall. – mook765 May 14 '20 at 12:37
  • 1
    On a stock Ubuntu system, that command should have none nothing at all (no 'sudo'). However, if you used 'sudo', or were (unwisely) using a root prompt, then that command would damage your system beyond convenient repair. Backup your data (fix it too; Your data now has the wrong ownership) and then reinstall. – user535733 May 14 '20 at 12:40
  • The server has no other user accounts . My concern is will this breaks the booting ? I cant even think about it – Shan May 14 '20 at 12:44
  • Exactly which release of Ubuntu is this server running? – user535733 May 14 '20 at 13:23
  • The server version is : Ubuntu 18.04.3 – Shan May 14 '20 at 21:14

1 Answers1

0

This is a fatal error. There is no way you can correctly restore the file permissions. So, reinstall or restore from a system backup.

vanadium
  • 82,909
  • 6
  • 116
  • 186
  • Until this day, there isn't any problems. Tried restarting also. But i accept this answer, considering the depth if the issue that could impact on the system. – Shan Jun 10 '20 at 19:38
  • As such, you may not have had issues because the command made `root` owner of every last file on the system, but indeed, it is fundamentally impossible to restore the ownerships to their original state (which for system files will be root:root in the majority of cases anyway). – vanadium Jun 11 '20 at 09:47
  • completely agree with you – Shan Jun 11 '20 at 12:29