What kind of a bug is this?
This is a tomato hornworm. They eat tomato leaves, but this one should be saved and not destroyed because the white rice-like particles on its back are the cocoons of a tiny wasp which has parasitized it. The wasp's larva are killing the hornworm for you. If you leave it alone, the cocoons will hatch into more of these tiny wasps, and they'll kill any other tomato hornworms around. That's good, because the tomato hornworm can do a lot of damage, but their green coloration makes them hard to see.
Here is good info about the tomato hornworm--especially look for the section about prevention: http://extension.umd.edu/growit/insects/tobaccotomato-hornworm