A man was heard screaming for his life moments before he was stabbed to death in a random and unprovoked attack at a bus stop in Sydney's inner west, a witness says.

Police said the 51-year-old is not believed to have known the 28-year-old man accused of murdering him.

The attack took place on the corner of Salisbury Road and Church Street in Camperdown, not far from the University of Sydney and several blocks from King Street in Newtown, about 9pm on Thursday.

The victim is believed to have been waiting for a bus to his home in Earlwood when he was repeatedly stabbed in the chest.