At some point, a Dark Jedi or a Sith Lord was killed on Dagobah. The details are pretty sketchy, but it left a bunch of Dark Side energy in some cave there. Many years later, Yoda chose it as a hiding place because of the planet's own obscurity, and because the massive amount of life made him harder to detect. He hung out there for 20 years talking to himself until Luke Skywalker showed up to be trained. The highlight of the training was when Luke entered the dark cave, and fought against a vision of Darth Vader. Yoda warned Luke not to abandon his training, but Luke didn't listen. In retrospect Luke's actions had no negative impact on him or his friends. Occasionally Luke sent his own students to Dagobah to try their luck in the cave.
Just Yoda. Nobody else bothered living there before or after him.