How do I prevent people not in my course from accessing it?

Valid for Moodle 2.5.  Updated on 9/9/2013.

  1. In the Settings block on the left, in the Course administration section, click on the Edit settings link.

    Course Administration block

  2. On the course settings page, scroll down to the Guest Access section. For the Allow guest access item, select No from the pull-down menu.

    Guest access settings

  3. Scroll down and click on Save Changes.

By default, courses are built with guest access turned off.

If you set guest access to Yes you can then attach a password.  Only guest with the password will be allowed access.

Note that guests will have access to resources, but not to activities.