There's no way to prevent students from sharing logins, but we don't see this issue often.
This is for a couple of reasons:
On a shared account, it would be hard for an individual to keep track of their progress through the course. For example, the content would already be marked as complete. So there would be little benefit to sharing logins.
Also, generally, most online students are honorable people!
You will be able to track student activity from your admin dashboard to keep watch for login sharing. If you spot anything suspicious you can always reach out to the user and remove their access if you choose to.
If you're particularly concerned, our Mixpanel integration makes login sharing even easier to spot. You'll be able to see whether the same account is being accessed from multiple locations. Bearing in mind that it may just be the same person on different devices of course!