Why can't I run composer install root access?

Under the VPS logged in as root, do composer require / install, and the composer says don't do this case root.
Why? What harm from it?
March 23rd 20 at 18:54
2 answers
March 23rd 20 at 18:56
the composer has the opportunity to write pre - and post-install scripts, which being run under root can harm the system or steal sensitive data
March 23rd 20 at 18:58
Include simple logic - root access any script running with full access to the body, including the ability to perform destructive operations are not asking permission from the naive user. So? So.

Further - a Composer we put third-party code, hell knows what's in that code (you're not personally checked all packages, and then recursively their dependencies, and dependencies of their dependencies). Therefore, it is do - ay-ay-Yai-opasnosti. Risky. About the Composer as it suggests.

Besides, to do anything root access on the server is a bad practice. It is for the same reasons - that the old fashioned way not kopipastit some code from the Internets to the command line - but how do comment @FanatPHP about the classics.

Should be a separate user, which you connecting, and he's right sudo. To use these rights only in extreme cases where they are really needed.

Find more questions by tags Composer