For example, see https://www.elsevier.com/about/policies/copyright (under "Author Rights") for what Elsevier permits you to do with your own work.
On the other hand, publishers have sometimes filed lawsuits against sites where authors share their papers, e.g. ResearchGate: https://www.nature.com/articles/d41586-018-06945-6
Elsevier have also sent takedown notices to universities where academics have made the final version available on their institutional websites:
https://www.washingtonpost.com/news/the-switch/wp/2013/12/19...
https://osc.universityofcalifornia.edu/2013/12/elsevier-take...
https://news.harvard.edu/gazette/story/newsplus/elsevier-tak...
https://blogs.library.duke.edu/scholcomm/2014/01/28/setting-...