A connector, comprising: a case-shaped attachment member including a through-hole in a sidewall; a first housing which is provided outside of the attachment member and includes a first fitting portion accommodating a first terminal, the first fitting portion being inserted through the through-hole; a second housing which is provided inside of the attachment member and includes a second fitting portion which is capable of being fitted to the first fitting portion and accommodates a second terminal; and a first seal member which is provided in close contact with an outer periphery of the first housing and is brought into close contact with the through-hole for sealing between the inside and outside of the attachment member, wherein the first housing includes: an outer housing provided with a fixation portion which is fixed to the sidewall of the attachment member; and an inner housing which is provided on an inner peripheral side of the outer housing to move in a fitting direction that the first housing is fitted to the second housing and includes the first fitting portion, the inner housing is provided with a pressing rib on an outer periphery of the first fitting portion, the pressing rib having an outer diameter small enough to be inserted through the through-hole and being located facing an end surface of the outer housing in the fitting direction, a second seal member is provided between the end surface of the outer housing in the fitting direction and a surface of the pressing rib facing the end surface, the second seal member coming into close contact with the pressing rib and the end surface of the outer housing in the fitting direction for sealing between the outer housing and the inner housing, and a restricting portion is provided in a side of the through-hole closer to the inside of the attachment member, the restricting portion being configured to come into contact with the pressing rib to restrict movement of the pressing rib in the fitting direction. a case-shaped attachment member including a through-hole in a sidewall; a first housing which is provided outside of the attachment member and includes a first fitting portion accommodating a first terminal, the first fitting portion being inserted through the through-hole; a second housing which is provided inside of the attachment member and includes a second fitting portion which is capable of being fitted to the first fitting portion and accommodates a second terminal; and a first seal member which is provided in close contact with an outer periphery of the first housing and is brought into close contact with the through-hole for sealing between the inside and outside of the attachment member, wherein the first housing includes: an outer housing provided with a fixation portion which is fixed to the sidewall of the attachment member; and an inner housing which is provided on an inner peripheral side of the outer housing to move in a fitting direction that the first housing is fitted to the second housing and includes the first fitting portion, the inner housing is provided with a pressing rib on an outer periphery of the first fitting portion, the pressing rib having an outer diameter small enough to be inserted through the through-hole and being located facing an end surface of the outer housing in the fitting direction, a second seal member is provided between the end surface of the outer housing in the fitting direction and a surface of the pressing rib facing the end surface, the second seal member coming into close contact with the pressing rib and the end surface of the outer housing in the fitting direction for sealing between the outer housing and the inner housing, and a restricting portion is provided in a side of the through-hole closer to the inside of the attachment member, the restricting portion being configured to come into contact with the pressing rib to restrict movement of the pressing rib in the fitting direction.