You need to have the ‘course manager’ role to be able to set up an enrolment key for your course and switch off guest access.
In the course, go to Course administration – OpenLearners – Enrolment methods.
Hide ‘self enrolment’ and ‘guest enrolment’ methods
Click on the editing button for ‘OpenLearn Enrolment so the editing form appears
Where it says ‘enrolment key’ insert the enrolment password for the course
Save changes