Try offering him alternatives? For example, shaking hands, high-5s... Talk to him about his feelings and thoughts, like what makes him want to hug and kiss a particular classmate. Does he like that classmate or is he happy to be around that classmate? If so, then teach him that different people like to be friends in different ways, and to receive love in different ways. You can tell him that hugs and kisses are for daddy, mummy and people very close to him. For friends, the alternatives mentioned above are good choices. Practise these new methods of showing friendship with him and help him get excited about trying them out in school. Get him comfortable with talking to his classmates too, with phrases he can say to be friendly, instead of using the hugs and kisses. You’ve raised a loving boy:) Social etiquette is something that kids will need time to learn. Hope things become better for you soon!
Got the same feedback from teacher my girl was 17 month old. Wasnt embarrassed, just jealous of her classmates.
The girl used to be affectionate too but she grew out of it suddenly.