How can an IPFS host avoid hosting illegal material?

If an IPFS host is completely open, in time it will inevitably host undesirable or illegal content. If it is closed to only a restricted set of users, then it become much like a private server and that defeats the objective of IPFS. Thoughts?

There might be a misconception about what IPFS is. Nobody can tell your node what to host (except with some specific configurations or tools like ipfs-cluster). So you won’t knowingly host illegal material unless you ask for them.

To be clear, when a node “add” a file to IPFS, what it really does is advertising that it has a copy available for other nodes to fetch. No bit from the actual data is actually transferred to anyone until they ask for it.

NB: There is also a preliminary project to have maintain blacklists of hashes you might not want to receive or serve, should you request them by accident.