Trading ships (for instance giving virals hard to find ships to RE) and planets (purposely giving planets to someone) is illegal and can get you in big trouble (suspension, etc.).
Ore comes from planets; to harvest more ore from a planet build more mining on the planet (this only increases the amount of ore you extract per turn...it does not increase the amt. of minerals you produce and once your ore is depleted you will stop getting ore from that planet). Exploring for planets is also another option if you need more ore (look for icy planets that usually have a ton of ore). Of course you can always buy ore from the market (though it is pretty expensive for players just starting off).