1

I followed this tutorial to install iRedMail on my CentOS 7 x64 System: https://www.digitalocean.com/community/tutorials/how-to-install-iredmail-on-centos-6-5-x64

Why the *"$@*3 is / now owned by postfix:root?? I don't get this... After the installation script was finished, nothing worked anymore because of wrong permissions:

[root:~]# ls -ald /
drwx------ 18 postfix root 4096 20. Jun 21:08 /

[root:~]# ls -al /
insgesamt 56
drwx------ 18 postfix root 4096 20. Jun 21:08 .
drwx------ 18 postfix root 4096 20. Jun 21:08 ..
lrwxrwxrwx  1 root    root   39 20. Jun 21:08 aquota.group -> /proc/vz/vzaquota/000092ef/aquota.group
lrwxrwxrwx  1 root    root   38 20. Jun 21:08 aquota.user -> /proc/vz/vzaquota/000092ef/aquota.user
-rw-r--r--  1 root    root    0 17. Jun 12:22 .autorelabel
lrwxrwxrwx  1 root    root    7 17. Jun 12:14 bin -> usr/bin
dr-xr-xr-x  3 root    root  160 17. Jun 12:15 boot
drwxr-xr-x  6 root    root  700 20. Jun 21:08 dev
drwxr-xr-x 86 root    root 4096 20. Jun 21:08 etc
drwxr-xr-x  6 root    root 4096 20. Jun 21:04 home
lrwxrwxrwx  1 root    root    7 17. Jun 12:14 lib -> usr/lib
lrwxrwxrwx  1 root    root    9 17. Jun 12:14 lib64 -> usr/lib64
drwxr-xr-x  2 root    root 4096 12. Aug 2015  media
drwxr-xr-x  2 root    root 4096 12. Aug 2015  mnt
drwxr-xr-x  3 root    root 4096 20. Jun 21:05 opt
drwxr-xr-x  2 root    root 4096  5. Okt 2007  private-backup
dr-xr-xr-x 64 root    root    0 20. Jun 21:08 proc
dr-xr-x--- 11 root    root 4096 20. Jun 21:13 root
drwxr-xr-x 29 root    root  760 20. Jun 21:08 run
lrwxrwxrwx  1 root    root    8 17. Jun 12:14 sbin -> usr/sbin
drwxr-xr-x  2 root    root 4096 12. Aug 2015  srv
drwxr-xr-x  7 root    root    0 20. Jun 21:08 sys
drwxrwxrwt 19 root    root 4096 20. Jun 21:08 tmp
drwxr-xr-x 13 root    root 1392 17. Jun 12:15 usr
drwxr-xr-x 21 root    root 4096 20. Jun 21:04 var
-rw-r--r--  1 root    root    0 20. Jun 21:08 .vzfifo
[root:~]# 

Is my complete system gone now? Or is this fixable? And most important: How can I install iRedMail next time without destroying my system?

  • 1
    At least at first glance only the permissions of / seem to have been mangled. This should be easily fixable by running chown root:root / and chmod 755 /. – Martin von Wittich Jun 20 '16 at 20:04
  • Thank you really much @MartinvonWittich! I did chown root:root / before, but it did not work. I forgot to set chmod 755 /, but now it works perfectly. Thanks! – Benni Jun 20 '16 at 20:13
  • 1
    There's 36 obvious calls to chown in that blob-o-code, though none that obviously would set the ownership on /, unless one of the Postfix configuration files was named / for some reason. – thrig Jun 20 '16 at 21:57
4

This proves yet again that if you run random scripts off the Internet, you lose.

Who wrote that tutorial? More importantly, who wrote this "iRedMail" thing? (never heard of it). Did you review the script, so that you're sure it didn't do anything else wrong?

In the best case, that script (I didn't review it) simply has a bug which caused it to set permissions on an empty variable that it prepends with a "/". In the worst case, your server is now pawned, and you should reinstall it.

  • I set the permission of / back to root:root (how it should be), but I still can't su to another user: su: failed to execute /bin/bash: Permission denied. So yeah, I think my system is pretty much broken. The tutorial is from digitalocean, which should be pretty reputable. The installer script is the original installer script provided by iRedMail, which is an open source mail server solution. To be honest, it's the first time i give it a try. It seems pretty legit to me. Edit: My permissions work perfectly now thanks to @MartinvonWittich – Benni Jun 20 '16 at 20:11
  • 1
    Probably a combination of 'cd /' at one point, a 'cd /some/nonexistent/dir/' with no error checking, then chown on . Just take this as an object lesson on why it is a bad idea to run random non-distro software you found on Google. – jsbillings Jun 22 '16 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.