We develop strong and weak maximum principles for boundary-degenerate elliptic and parabolic linear second-order partial differential operators, A u := − t r ( a D 2 u ) − ⟨ b , D u ⟩ + c u Au := -\mathrm {tr}(aD^2u)-\langle b, Du\rangle + cu , with partial Dirichlet boundary conditions. The coefficient, a ( x ) a(x) , is assumed to vanish along a nonempty open subset, ∂ 0 O \partial _0\mathscr {O} , called the degenerate boundary portion, of the boundary, ∂ O \partial \mathscr {O} , of the domain O ⊂ R d \mathscr {O}\subset \mathbb {R}^d , while a ( x ) a(x) is nonzero at any point of the nondegenerate boundary portion, ∂ 1 O := ∂ O ∖ ∂ 0 O ¯ \partial _1\mathscr {O} := \partial \mathscr {O}\setminus \overline {\partial _0\mathscr {O}} . If an A A -subharmonic function, u u in C 2 ( O ) C^2(\mathscr {O}) or W l o c 2 , d ( O ) W^{2,d}_{\mathrm {loc}}(\mathscr {O}) , is C 1 C^1 up to ∂ 0 O \partial _0\mathscr {O} and has a strict local maximum at a point in ∂ 0 O \partial _0\mathscr {O} , we show that u u can be perturbed, by the addition of a suitable function w ∈ C 2 ( O ) ∩ C 1 ( R d ) w\in C^2(\mathscr {O})\cap C^1(\mathbb {R}^d) , to a strictly A A -subharmonic function v = u + w v=u+w having a local maximum in the interior of O \mathscr {O} . Consequently, we obtain strong and weak maximum principles for A A -subharmonic functions in C 2 ( O ) C^2(\mathscr {O}) and W l o c 2 , d ( O ) W^{2,d}_{\mathrm {loc}}(\mathscr {O}) which are C 1 C^1 up to ∂ 0 O \partial _0\mathscr {O} . Points in ∂ 0 O \partial _0\mathscr {O} play the same role as those in the interior of the domain, O \mathscr {O} , and only the nondegenerate boundary portion, ∂ 1 O \partial _1\mathscr {O} , is required for boundary comparisons. Moreover, we obtain a comparison principle for a solution and supersolution in W l o c 2 , d ( O ) W^{2,d}_{\mathrm {loc}}(\mathscr {O}) to a unilateral obstacle problem defined by A A , again where only the nondegenerate boundary portion, ∂ 1 O \partial _1\mathscr {O} , is required for boundary comparisons. Our results extend those of Daskalopoulos and Hamilton, Epstein and Mazzeo, and Feehan, where t r ( a D 2 u ) \mathrm {tr}(aD^2u) is in addition assumed to be continuous up to and vanish along ∂ 0 O \partial _0\mathscr {O} in order to yield comparable maximum principles for A A -subharmonic functions in C 2 ( O ) C^2(\mathscr {O}) , while the results developed here for A A -subharmonic functions in W l o c 2 , d ( O ) W^{2,d}_{\mathrm {loc}}(\mathscr {O}) are entirely new. Finally, we obtain analogues of all the preceding results for parabolic linear second-order partial differential operators, L u := − u t − t r ( a D 2 u ) − ⟨ b , D u ⟩ + c u Lu := -u_t - \mathrm {tr}(aD^2u)-\langle b, Du\rangle + cu .