No you don't have to publish your course in order to allow your students to enrol. Please see this blog post about What does Publish a course mean?
Mary Cooch への返信
How to share my course with the users I have enrolled in my moodle, help please
- Rishabh Shukla の投稿
Rishabh Shukla への返信
Re: How to share my course with the users I have enrolled in my moodle, help please
- Mary Cooch の投稿
Rishabh - please read the documentation Admin quick guide and Teacher quick guide as they explain the difference between allowing users into your site (="authentication") and allowing users into a course (= "enrolment")