D
考查定语从句。the man是先行词,带入定语从句____ my teacher just shook hands,应是my teacher just shook hands with the man.所以选D。