I ran this command on my ubuntu server 12.04 by mistake:
chown someuser / -R
On RHEL it would be fixed by this command:
rpm --setugids -a
Is there anyway to fix it in ubuntu server?
Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.
if you have another similar server you can try:
ideally.. restore from backups on a brand new machine.
if you are going to run it.. check 10 times the output of
before you pipe it to bash
If you have installed software on the box since its install, then it is unlikely you will be able to recover (with the exception of backups). Some software, during install, will create a new user. If that new user is used to set ownership on files and directories for the new program. If the OS does not have "knowledge" of those new programs, then it cannot revert ownership to the correct uid/gid. When you issued "chown someuser / -R" - you changed all files on the system. Depending upon if you had mounted filesystems from other servers and permissions were set to your disadvantage...you may have changed ownership to "someuser" on other servers as well. Further, trying to copy ownership from another box may not be advisable....user "joe" may have UID 554 on server A and "joe" may be UID 789 on server B. You would have to ensure that UIDs are not mixed between the servers...UID 554 may be for some ftp user on server B...so, copying from A to B may have undesired results.