Whenever any bond or recognizance is required, or permitted, by law to be made, given or filed, conditioned upon the doing or not doing of anything specified therein and to be signed by one or more persons as sureties, each of such sureties shall be a resident of this state; but no attorney-at-law, sheriff, clerk of any court of record, or other officer of such court, shall be permitted to become such surety.