I'll admit, this is a funny one... Anakin's surname is Skywalker, but Leia takes on the name of her adopted family (Organa). Luke's aunt and uncle have the surname Lars, yet he's still known as Skywalker. This clearly shouldn't be something his uncle and aunt wanted since they were very against the Jedi and their position in the fall of the Republic. As such, it may have been Obi-Wan that told him he was a Skywalker. It doesn't seem to be the most effective way of keeping someone hidden, that's for sure. Perhaps the upcoming Obi-Wan Kenobi Disney+ series will offer some answers!