I have to briefly describe the situation. We are planning to make a computer classroom with workstations running Ubuntu 10.04. Since making accounts for each student has not been considered reasonable, we decided to make accounts for each student group. We don't want students to share their passwords between groups so the solution would be not to give them passwords at all, but let the teacher log them in instead. Obviously he shouldn't go from one machine to another typing in credentials by hand, so we need some script that will connect to a remote machine by ssh and make GDM (or probably any other login manager if GDM cannot serve this purpose) log in specified user. I couldn't find any solutions, as well as I haven't noticed anybody in similar situation asking for help, so my question will be: can the scheme described be realized and if yes, then how? Thanks in advance.
In all honesty... you're going to have even more problems if you neglect to create a unique username for each student. There are many ways to create an authentication server so you only need to create each user-account once... and have each workstation pull from there... which would be the best option. (you can also use those credentials for many other things.)
As far as remotely logging-in or unlocking a workstation... if you're set on doing it... your best bet is to use VNC to gain control of the remote workstation & login. As far as I know, there is no script-able way to unlock a workstation.