Most replacement lock cylinders are keyed individually and don't match other cylinders, so to have matching keys, it is necessary to re-key the lock cylinders. Kits to re-key up to six doors with matching keys are commonly available at many home improvement and hardware stores. You must remove the old cylinder and change the pins to re-key the lock. Most kits are made for specific lock brands and do not work on other types of locks.
All of the tools needed to re-key a door typically come in the kit except for a screwdriver. Insert the key into the lock on the door knob and rotate it to the unlocked position. Remove the door knob and lock cylinder by inserting the wire tool into the hole on the neck of the door knob, tripping the release lever and pulling the knob and lock free from the door.
Remove the lock cylinder housing from the door knob and use the retaining ring removal tool to force the thin retaining ring off of the cylinder. Remove the cylinder plug and change the pins according to the instructions in your kit. Reassemble the door knob and repeat the process for all of the doors. If more than six door locks are needed, additional pins are usually available from the manufacturer.