By default, when you reserve the lab for Linux or Labtest mode, your booking will have no user restrictions. That is, any student can login to any lab machine including students who are not part of your course. Ultimately, this is the simplest setup as once you enable user restrictions, there is always the potential to inadvertently restrict students from logging in who should otherwise be able to login! As a result, if you wish to have the ability to restrict access to the lab machines to specific students, you must make this part of your booking request.
Once tech has enabled “user restrictions” on your lab booking, the next step is for you to configure it. To do this, place a file called users.allow in your course directory - /eecs/course/<COURSE>. This file contains one user who is allowed to login per line. For example, if only cse1234 and cse5678 are allowed to login during your booking for EECS9999, then /eecs/course/9999/users.allow would contain:
cse1234 cse5678
IMPORTANT NOTE: The users.allow file must be readable by the system, or it will be ignored and your restrictions will not be followed. To make the users.allow file for EECS9999 readable by the system: chmod o+r /eecs/course/9999/users.allow
When the machines boot into Linux or Labtest mode, a “RESERVED” message will appear on the bottom of the login screen. If a student who is not in the allow list tries to login, he will see a message as follows:
The computer that you are trying to use has been reserved and is not available for your use at this time. Sorry for any inconvenience.
The users.allow file may also contain an optional “#include” directive. For example:
#include /eecs/course/9999/users.contest #include /eecs/course/9999/otherusers
NOTE: There used to be a “#includedist” directive which would allow you specify a distribution list. Distribution lists are no longer available in labtest mode, and hence this does not work. An alternate solution is provided below.
If your lab booking includes multiple machines, and you wish to restrict different users logging into different machines, this functionality is available as well. Simply append “.<HOSTNAME>” to the users.allow file in your course directory to restrict users to a specific host. For example, assume that you are teaching EECS9999, and have booked machines ea01 through ea10. You want to restrict “cse1234” to logging into host “ea01”, “cse5678” to logging into “ea02”, but your other students “cse91011” and “cse91112” can login to any other ea host. To do this, create /eecs/course/9999/users.allow.ea01 and put in it:
cse1234
Create /eecs/course/9999/users.allow.ea02 and put in it:
cse5678
Create /eecs/course/9999/users.allow and put in it:
cse91011 cse91112
If you want to allow access to your test to only users who are enrolled in your course, then you can extract this information from the distribution list prior to your test. For example:
% awk '{ print $1 }' /eecs/dept/dist/EECS9999 | grep -v "<NO-CS-ACCT>" > /eecs/course/9999/users.allow % chmod 644 /eecs/course/9999/users.allow
If you wish to test whether a user will be able to login during your lab booking, you can use the pcmode-allow command. This is the identical command used by the system during login to verify whether a user should be able to access a given machine. For example, assume that your booking has ID 6 (as per the pcmode schedule), and you want to check whether a user “cse1234” will be able to login to “ea01” during your test. Execute the pcmode-allow command as follows:
% /xsys/pkg/pcmode/bin/pcmode-allow cse1234 6 ea01
Proper responses will be one of:
NOTE: