Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This is for academic purpose. I am looking for a good option where students can log in to the system using a username and password and I can monitor what the students are doing. Students should be given bash shell only. I want to restrict student from accessing same account. This is for giving a programming assignment to a set of students. The major requirements are

  1. Students are not allowed to use others account
  2. I need to make sure all of them logged in
  3. They need to get access to the shell only

What are the available good options. I have access to Debian GNU/Linux in all the syste

share|improve this question

3 Answers 3

up vote 1 down vote accepted

1. Students are not allowed to use others account

You'd be hard pressed to force the students to not share authentication credentials with each other, unless you go with something like biometrics. Even physical tokens can be passed from one person to another. Alas, you essentially cannot guarantee this.

2. I need to make sure all of them logged in

You can make sure that each account was logged in to using something like last -n1 | grep 'still logged in'. Process accounting might also be a workable approach, depending on what your specific needs are.

3. They need to get access to the shell only

That wouldn't be particularly useful, since it implies that they cannot do something as trivial as getting a directory listing (/bin/ls), an editor, writing text to a file (/bin/cat - > filename), try their solutions at the programming assignments you give them (which implies executing an interpreter, or a compiler, linker and the final executable).

What about your environment precludes the possibility of just giving each student a normal user account with access to standard tools? If you don't want a GUI on the system, you can either choose to not install X, or provide only unprivileged SSH access with X forwarding disabled. But if your goal is to restrict e.g. web access, do note that there are quite a few text-based web browsers available, and if sufficiently motivated, one can bootstrap such a process using relatively trivial software using readily available (and often required) modules.

share|improve this answer
    
Its oj if there is a method where I could know that who all are logged in and what all commands they are using –  user61954 Apr 3 '13 at 17:13
    
@user61954 all you'd need to do is run who to see who is logged in or parse the last output as suggested here. and check the individual ~/.bash_history files as others have suggested. –  terdon Apr 3 '13 at 17:49

For the monitoring, why not just have a look at each user's .bash_history file? You could clear / archive it on login if you need to log individual sessions.

As far as checking who's logged in, you've got w and last at your disposal.

For "shell-only" access you could make sure that that sshd is configured and instruct them to connect using PuTTY.

share|improve this answer
    
$ unset HISTORY –  Michael Kjörling Apr 3 '13 at 14:43

To prevent students from using each other account, this can be simply done by the way they submit their tests. For example, I will ask them that at the end of the test, they should run a specific command (basically a script that you have prepared) inside their work directory. This script can encrypt and tar their work directory; send it to you by email or just store it in some secret location. The script should also delete the student working directory after submission. This way, even if someone uses another persons account, he can not get his work by any means.

As for monitoring their logins, I will use who and last.

For Shell only access, you can run the linux machine/server they will using into runlevel 3. You can also modify tweak /usr/bin/startx and your DM scripts to prohibit them from starting, even if someone tried to start them manually. For example, I will comment out all the lines in startx and append one line to the end echo "You are not allowed to start X during the exam. This incident have been reported ...".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.