There are several lessons to be learned from a data breach in which hackers gained access to Mark Zuckerberg’s social media accounts, but chief among them is probably this: Quit using the same password for multiple websites.

It may be annoying and time-consuming, but following this simple rule can help you avoid the public pwning, or account takeover, that befell Mr. Zuckerberg, the billionaire owner of Facebook and Instagram.

A collective that calls itself OurMine boasted that it had broken into a handful of his social media accounts, including LinkedIn, Twitter and Pinterest. Screengrabs posted by Engadget showed the hackers notifying Mr. Zuckerberg of the breach using his own Twitter account. Bold move.

“We are just testing your security,” the tweet read.

In a statement released on Monday, LinkedIn said that it had found and removed a fake profile that had been created of Mr. Zuckerberg.