The account of Rahab and the spies in Joshua 2 doesn't provide the names of the men.
Rahab
Rahab helped 2 Isrealite spies get into a city. the isrealites saved her and her family in return when they attacked the city.
rahab
Rahab hid the spies who were sent by Joshua.
They returned from Rahab after three days (Joshua 2).
Rahab had flax on her roof as part of her occupation as a cloth merchant. Flax was used to make linen, and drying it on the roof was a common practice. This detail is significant in the biblical narrative, as it provided a means for Rahab to hide the Israelite spies sent by Joshua, allowing them to escape undetected.
Rahab submitted herself to the spies and also helped them get information. This is a show of servant-hood and that is why she was spared.
Rahab helped the two Israelite spys hide when they were spying on Jericho
simply because she feared the God of Israel and knew that He was the God in heaven above and on earth beneath. (Joshua 2:9-11)
Rahab was a Canaanite woman, which means she was of Canaanite nationality. She is best known for helping the Israelite spies in Jericho.
One of the most famous episodes in the biblical conquest of Canaan was the assault on the city of Jericho. Joshua had the priests march around the city walls and Yahweh caused the walls to collapse, allowing the Hebrews to storm the city. However, we now know from archaeologists that there had been no city at Jericho for centuries before the arrival of the Hebrews.As a prelude to the attack on the city, Joshua sent two spies, who found refuge with the harlot, Rahab, who in turn made a covenant to be spared when the attackers slaughtered her fellow citizens (Joshua chapter 2). Now, even if there really had been an assault on Jericho, this is an improbable story, since the spies provided no information of value, and were unlikely to do so.Perhaps the simplest answer could lie in that the name Rahab (or Rachab) is very similar to the Hebrew verb rāhab, generally translated as either 'to beset, storm or assault,' or 'to be proud/arrogant'. If Joshua was about to storm or assault Jericho, would this have given rise to the fictional harlot's name, Rahab?