There are many ways of greeting people,both and informal.
The speaker's task is to choose an appropriate one for the situation.
It is also useful to know lots of different ones so as to not repeat yourself when you meet
a number of people at the same time.
As with any other aspect,you need to be careful about using informal expressions with people who you do not know well or whole rank or status is higher than yours.