Abu TamimahHujaymi (RA) reported that a man of his community said: I looked for the Prophet (SAW) but could not find him. So I sat down. Suddenly a group of men appeared and he was one of them. I did not necognise him. He was patching up differences between them. When he had finished, some of them stood with him and said, “O Messenger of Allah (SAW)” When I heard that, I said, “Alaykas salaam, O Messenger of Allah (SAW), alaykas salaam, O Messenger of Allah (SAW) , alaykas salaam, O Messenger of Allah (SAW) .” He said, “The words alaykas salaam are greeting for the dead.” Then he turned to me and said, “When you meet a man, your brother Muslim, you must say as-salaamu alayum wa rahmatullah wa barakatuh.” Then he responded to my salaam, saying. “wa alayka wa rahmatullah, wa alayka wa rahmatullah, wá alayka wa rahmatullah.”
[Abu Dawud 4084, Ahmed 15955]