When I do something that is not trivial and needs some research, I try to summarize it and write it down, in case that I will need later to do the same thing again. It may also be useful for other people that could be trying to do something similar.
Thursday, August 9, 2012
Computer LAB Management
We have two labs with 16 computers each. In each computer we have installed the latest version of Edubuntu (Linux) with almost the same configuration (partitions, installed packages, etc.). It is a bit of hard work to manage all of them one by one, so we have tried to find workarounds to manage all of them at once. There are different ways and solutions to accomplish this in Linux, but we have adopted a simple and practical one, suitable for our case.
Table of Contents
Setting a static IP to each computer
Managing computers remotely
Administrating multiple computers at once
Getting the mac addresses
Turning on all the computers remotely
Turning OFF all the computers remotely
Adding an administrator user
1. Setting a static IP to each computer
First of all, it is better to set a static IP to each computer, instead of letting them to get a dynamic (random) IP by DHCP. This is required for accessing and managing them remotely. It can be done like this:
First of all disable/remove the network-manager service, because it will try to configure automatically the network interface:
apt-get purge network-manager
Then edit /etc/network/interfaces like this:
iface lo inet loopback
iface eth0 inet static
dns-nameservers 126.96.36.199 188.8.131.52
Finally, restart the networking:
sudo /etc/init.d/networking restart
Note: It is even better if we configure the DHCP server to give always the same IP to the same computer, based on the MAC of its network interface. However the method above is quite ok.
2. Managing computers remotely
In order to run commands remotely through ssh, without entering a password, we can generate a public-private key pair, and then put the public key on each computer.
Generate a public/private key pair:
Transfer the public key to each PC and append it to /root/.ssh/authorized_keys:
The computers in LAB1 initially were installed with user student as administrative user. These steps show how to add another administrative user and how to remove the administrative privileges from the user student.