When any ship, vessel, or steamboat shall arrive at any port or harbor with alien passengers on board, who are to be landed or left, and who may become a charge as paupers, the master or commanding officer of the vessel shall, before such passengers, or any of them, leave the ship, vessel or steamboat, deposit with the supervisor of the district where the passengers are to be landed or left, a list of their names, and shall forthwith enter into bond, with sufficient sureties, payable to the county, in a sufficient penalty, with condition to indemnify the county from all expenses which may arise from supporting or maintaining such aliens; and in default of such bond, the captain, master, or commander may be committed by any justice of the peace, or mayor of any city, town, or village, until the bond be executed; and, moreover, the captain, master, or commander shall be liable to be indicted, and, on conviction, shall be fined in the sum of one hundred dollars ($100.00) for each person landed in violation of this section; but the board of supervisors, on investigation of the matter, may dispense with the bond.