Composing is possible in bear country, and will not be a bear attractant if maintained correctly. The key is to make sure that your compost bin is not smelly!
Go Big on Brown
The key to a healthy compost bin is equal proportions of BROWN materials (carbon rich) and GREEN materials (nitrogen rich). This means that you should add BROWNS every time you add kitchen scraps, covering the scraps completely in layers no more than 4 inches thick.
BROWNS include: dead leaves, grass clippings, wood chips, sawdust and low quality household paper products that are shredded or cut up, like tissue paper, egg cartons, paper towels, junk mail, paper bags, and cardboard rolls.
GREENS include: kitchen scraps, vegetables, and small amounts of fruits.
Never add meat, fish, dairy products, oil, unrinsed egg shells, cooked food, or large amounts of fruit. These items will attract bears and other animals long before they decompose.
You need to aerate and turn your compost bin for it to function properly and to prevent it from getting smelly and attracting bears. Use a stick or pitchfork to turn the contents of your bin at least every couple of weeks. Then, cover with more BROWNS. This will keep your compost from becoming smelly.
Keep it Moist
Ensure the compost is kept moist, like that of a wrung out sponge. If the contents are too dry, it will take too long to decompose and if too wet, the contents may begin to smell.
Try Bear-Resistant Containers
As a last resort, you might purchase a commercially available bear-resistant container made of hard plastic. There are some with screw-in lids that are practically bear-proof.