First I created a file in this case filename with the commands I wanted to run inside it. I changed to the rancid user first and then created the file and ran the commands as rancid.
su rancid -s /bin/bash
cat filename
access-list 01 permit host xxx.xxx.xxx.xxx
snmp-server community STRING rw 01
Save the file as filename.
Then run clogin using this file and a hostname.
clogin -x filename hostname
Give the full path to clogin if needed, and if there is more than one host being changed use a space between each hostname.