Yes, this is completely legal. Anyone with a minecraft account may host a multiplayer server (you might not even need an account, but I'm not entirely sure on that point). As for os/spec requirements, you can run a dedicated server on linux or windows, minecraftwiki recommends at minimum 1GB ram/2GB disk for minecraft alone(not including os requirements), but a recommended amount is 2GB+ of ram and 10-15GB Hard Disk for a server of around 20-25 players. You can probably make do with less, but this is recommended