"drinking vessel," 1560s, "bowl, pot, jug," of unknown origin, perhaps from Scandinavian (cf. Swedish mugg "mug, jug," Norwegian mugge "pitcher, open can for warm drinks"), or Low German mokke, mukke "mug," also of unknown origin.
"a person's face," 1708, possibly from mug (n.1), on notion of drinking mugs shaped like grotesque faces. Sense of "portrait or photograph in police records (e.g. mug shot, 1950) had emerged by 1887. Hence, also, "a person" (especially "a criminal"), 1890.
"to beat up," 1818, originally "to strike the face" (in pugilism), from mug (n.2). The general meaning "attack" is first attested 1846, and "attack to rob" is from 1864. Perhaps influenced by thieves' slang mug "dupe, fool, sucker" (1851). Related: Mugged; mugging.