Piztu now manages Linux, Windows and mixed classrooms

Diagram of a Piztu classroom: teacher's computer running Linux Debian, with Linux Debian and Windows 10/11 clients

Piztu 26.12.2 no longer cares about penguins versus windows. A Linux Debian classroom, a Windows 10 or 11 classroom or a mixed one: all of them are managed from the same map and from the same teacher’s computer.

For a long time, Piztu meant a Linux classroom. With this release, students can work on Debian (or a derivative), on Windows 10 or Windows 11, or on a mix of both, and the teacher still sees a single classroom: power on, lock, sleep, shut down, send assignments and collect them.

There is one condition worth stating from the start: the server, that is, the teacher’s computer, has to run Linux. On Debian, with the official installer; on another distribution, if you build Piztu yourself. The clients, however, can be either.

1 · The idea: students are never administrators

The challenge of managing Windows from Linux is not technical, it is about trust: shutting down a computer, locking it or changing the firewall requires administrator rights, and we don’t want students to have them. Piztu solves this by splitting the roles:

Component Where it runs What it does
Piztu and the Salt master Server (Linux Debian) The classroom map and every command
Salt Minion Each Windows PC, as a SYSTEM service Does what needs privileges: shut down, sleep, lock, firewall, install Tao
OpenSSH Server Each Windows PC Sending and collecting assignments, with the student account
Standard account Each Windows PC The account students work with, without administrator rights

Why it matters: privileged commands run as SYSTEM through the Salt minion, and assignments travel over SSH with the student account. Neither path requires giving students the administrator password.

The Salt minion is the one that opens the connection to the server (TCP ports 4505 and 4506). That is why no inbound ports need to be opened on Windows for Salt: only for ping and SSH.

Piztu map of a mixed classroom: Linux (Tux) and Windows (window) computers on the same map, two of them switched off

2 · Names used in this post

In the examples, the server is called tux0 and the student computers tux01, tux02, tux03… On the network they appear as tux0.local, tux01.local, and so on. Replace these names with the ones in your classroom. Every command in this post was tested on Windows 11 Home with a standard user account.

3 · The teacher’s computer (Linux Debian)

Installing the server hasn’t changed. Download the installer from the latest release and run it as administrator:

wget https://github.com/piztusistemas/Piztu/releases/latest/download/Piztu_Debian_installer
chmod +x Piztu_Debian_installer
sudo ./Piztu_Debian_installer

The installer sets up the server, including the Salt master. When it finishes, open Piztu and, in classrooms with Windows computers, choose the Salt engine: it is the only one that performs administrative actions on Windows without the student account being an administrator.

If you haven’t done it yet, the installer walkthrough, the inventory and preparing the Linux clients are covered in Installing Piztu in your classroom: a step-by-step methodological guide. The Debian computers in your classroom follow exactly that procedure; this post focuses on what’s new: the Windows clients.

4 · Preparing each Windows client

These steps are done once on each computer, sitting in front of it and using a Windows administrator account (for example, the one created when the system was installed). Commands are run in a PowerShell opened as administrator.

4.1 · Create the student user (standard account)

Create the same user on every computer, with the same name as in Piztu (⚙ Classroom → Computer user, usuario by default). This account will be standard, with no administrator rights. You can do it from Settings → Accounts → Other users → Add account, or with PowerShell:

$u = 'usuario'
$p = Read-Host "Password for $u" -AsSecureString
New-LocalUser -Name $u -Password $p -PasswordNeverExpires -AccountNeverExpires
Add-LocalGroupMember -SID S-1-5-32-545 -Member $u     # Users group
Remove-LocalGroupMember -SID S-1-5-32-544 -Member $u -ErrorAction SilentlyContinue   # out of Administrators

Groups are given by their SID because the name changes with the Windows language (Administrators, Administradores…). Then sign in once with that account and sign out: this makes Windows create the profile folder (C:\Users\usuario), which we will need shortly.

Windows: Standard account type selected for the student user

To check it: Control Panel → User Accounts → Change account type. The student account must be set to Standard.

4.2 · Name the computer

All computers follow the same pattern and each one gets its number: tux01, tux02… The name must be unique, because it is what identifies the computer in Piztu and in Salt. Do it in Settings → System → About → Rename this PC, or with PowerShell:

Rename-Computer -NewName tux01 -Restart

The change takes effect after restarting. On the network, the computer will appear as tux01.local.

4.3 · Check that the server can see the client

From the server:

ping -c 3 tux01.local

If it doesn’t answer and both are on the same network, Windows most likely has the rule that allows inbound ping disabled. In an administrator PowerShell:

Enable-NetFirewallRule -Name "FPS-ICMP4-ERQ-In"

This rule only allows ping from the same subnet and applies to the Private and Public network profiles. Piztu uses ping to know which computers are switched on in the map, so it is not a minor detail.

4.4 · Install OpenSSH Server

The full guide is in Manual installation guide for OpenSSH Server on Windows 11. In short, in an administrator PowerShell:

Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
Set-Service -Name sshd -StartupType Automatic
Start-Service sshd
Get-NetFirewallRule -Name OpenSSH-Server-In-TCP    # port 22 rule, created automatically

From the server’s terminal, check that you can connect. The first time it asks whether you trust the computer (answer yes) and asks for the Windows account password:

ssh usuario@tux01.local

4.5 · Install the Salt Minion

Install on the client the same Salt Minion version as the server’s master: the minion must never be newer. You can check the server’s version with salt-master --version, and the available versions at packages.broadcom.com (currently 3008.5). It is best installed from PowerShell, because that way you set the server (MASTER) and the computer name (MINION_ID):

$master = 'tux0.local'     # the Piztu server, the teacher's computer (or its IP)
$id     = 'tux01.local'    # the computer name, same as in the Piztu inventory
$ver    = '3008.5'
$msi    = "Salt-Minion-$ver-Py3-AMD64.msi"
Invoke-WebRequest -UseBasicParsing -OutFile "$env:TEMP\$msi" `
  -Uri "https://packages.broadcom.com/artifactory/saltproject-generic/windows/$ver/$msi"
Start-Process msiexec.exe -Wait -ArgumentList "/i `"$env:TEMP\$msi`" /qn /norestart MASTER=$master MINION_ID=$id START_MINION=1"
Set-Service salt-minion -StartupType Automatic

Check that the service is running and that the client reaches the server:

Get-Service salt-minion                       # Status: Running
Test-NetConnection $master -Port 4506         # TcpTestSucceeded : True

Test-NetConnection may first show a warning that it failed over IPv6 (fe80::…). It doesn’t matter as long as it says True at the end.

PowerShell on Windows: the salt-minion service running and Test-NetConnection returning True

5 · Passwordless SSH: the classroom key

Piztu connects to the computers with an SSH key of its own for the classroom, ~/.ssh/id_rsa_piztu_aula, without asking for passwords. This is done from the server.

5.1 · Create the key

If you already have Linux computers in the classroom, the key is created in ⚙ Classroom → Create and send SSH key. Otherwise, from the server’s terminal:

ls ~/.ssh/id_rsa_piztu_aula.pub || ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/id_rsa_piztu_aula

5.2 · Copy it to Windows

Since the Windows account is standard, the key goes in its profile, at C:\Users\usuario\.ssh\authorized_keys. First check which shell Windows OpenSSH uses (it will ask for the password):

ssh usuario@tux01.local "reg query HKLM\SOFTWARE\OpenSSH /v DefaultShell"

If it answers powershell.exe, use option A. If it answers cmd.exe, or an error because the value doesn’t exist (the most common case), use option B. Option C always works. All of them ask for the password one last time.

Option A · PowerShell shell

ssh usuario@tux01.local "New-Item -Force -ItemType Directory $env:USERPROFILE\.ssh | Out-Null; Set-Content -Encoding ascii -Path $env:USERPROFILE\.ssh\authorized_keys -Value '$(cat ~/.ssh/id_rsa_piztu_aula.pub)'"

Option B · cmd shell

ssh usuario@tux01.local "if not exist .ssh mkdir .ssh & echo $(cat ~/.ssh/id_rsa_piztu_aula.pub)> .ssh\authorized_keys"

Option C · via sftp, with any shell

sftp usuario@tux01.local <<'EOF'
-mkdir .ssh
put /home/usuario/.ssh/id_rsa_piztu_aula.pub .ssh/authorized_keys
EOF

The most common mistake: if the Windows account were an administrator, Windows ignores that file and only reads C:\ProgramData\ssh\administrators_authorized_keys. The key is copied, but it keeps asking for a password. That is why the student account must be standard.

5.3 · Check

ssh -o BatchMode=yes -i ~/.ssh/id_rsa_piztu_aula usuario@tux01.local hostname
# tux01, without asking for anything
ssh -i ~/.ssh/id_rsa_piztu_aula usuario@tux01.local "whoami /groups | findstr S-1-5-32-544"

The second command must not print anything: if Administrators appears, the account is still an administrator. If Piztu was already open, close it and open it again, because it only looks for the classroom key at startup.

Server terminal: passwordless ssh to Windows returns tux01 and whoami /groups returns nothing

6 · Salt: accept the minion on the server

A few seconds after starting, the minion sends its key to the server, which has to accept it. On the server:

sudo salt-key -L                  # tux01.local under "Unaccepted Keys" (or already under "Accepted Keys")
sudo salt-key -p tux01.local | tail -3   # last lines of the public key
sudo salt-key -a tux01.local -y   # accept it

Piztu can accept the classroom computers automatically (autosign; in this classroom, those starting with tux): in that case the computer already appears under Accepted Keys and the last command isn’t needed.

To make sure the key belongs to the right computer, compare the last lines with what Windows itself shows (administrator PowerShell):

Get-Content 'C:\ProgramData\Salt Project\Salt\conf\pki\minion\minion.pub' | Select-Object -Last 3

Compare the text of the key, not the fingerprints: salt-call --local key.finger gives a different fingerprint from salt-key -f even when the key is the same.

Finally, test the communication from the server:

sudo salt tux01.local test.ping                    # True
sudo salt tux01.local grains.item os osrelease     # Windows, 11
sudo salt tux01.local cmd.run 'whoami'             # nt authority\system

The last command is the important one: Salt commands run as SYSTEM, not with the student account. That is why Piztu can shut down or lock the computer even though the account is standard.

7 · Add the computer to Piztu and test it

In ⚙ Classroom, add the computer to the inventory with the same name as the minion id. Scan the network stores its MAC address so it can be powered on with Wake-on-LAN. In the inventory file, the line looks like this:

tux01.local mac=aa:bb:cc:dd:ee:ff so=windows

The so=windows tag is what tells Piztu that the computer runs Windows. Debian computers don’t have it, and that is how both coexist in the same mixed classroom.

With the Salt engine active, try Lock, Unlock and Send assignments on that computer from the map. Try it with the SSH protocol too.

Windows computer with the Piztu lock screen active

Optional: power on over the network (Wake-on-LAN)

For Piztu to be able to power on the computer, disable Windows fast startup and enable Wake-on-LAN on the network card (administrator PowerShell). If the card doesn’t allow it, enable it in the BIOS/UEFI as well.

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power' -Name HiberbootEnabled -Value 0 -Type DWord
Get-NetAdapter -Physical | Where-Object Status -eq 'Up' | ForEach-Object { Set-NetAdapterPowerManagement -Name $_.Name -WakeOnMagicPacket Enabled }

8 · A shortcut: doing it with Claude Code

If you’ve read this far, you may be thinking: “for twenty computers, that’s a lot of typing”. You’re right. Setting up passwordless SSH and Salt communication, once both programs are installed, is very convenient with Claude Code: with the instructions in this post (or the same guide as a PDF), you can ask it to generate the key, copy it to each computer, accept the minions and check that everything responds, and it explains what it does at each step.

It isn’t required, and it isn’t magic: everything Claude Code does is exactly what is explained above. That is why the procedure is written the traditional way, step by step: so you can do it by hand, understand it, audit it or adapt it to your classroom, with or without help.

9 · Common problems

Symptom Cause Fix
Ping doesn’t answer Windows blocks inbound ping Step 4.3: Enable-NetFirewallRule -Name "FPS-ICMP4-ERQ-In"
ssh keeps asking for a password The account is an administrator, or the keys file is not in the profile Standard account (4.1) and repeat step 5.2
ssh from the terminal works, but Piztu doesn’t Piztu only uses the id_rsa_piztu_aula key Copy that key (5.2) and reopen Piztu
Error “Missing ‘(‘ after ‘if'” (or the equivalent in your Windows language) The Windows shell is PowerShell and the command was for cmd Use option A or C from step 5.2
The computer doesn’t show up in salt-key -L The minion doesn’t reach the server Check MASTER and Test-NetConnection (4.5); try the server’s IP
Minion did not return and the computer appears under Accepted / Denied The minion’s key changed (computer reinstalled) sudo salt-key -d tux01.local -y and accept it again (step 6)
“Access denied” when making system changes over SSH Expected with a standard account Do it through Salt (Salt engine) or with an administrator

10 · Detailed manuals

This post summarises two more complete manuals, with every variant, an explanation of each step and how to start from scratch (both in Galician):

 

Piztu — Martín Pardiñas · piztu.org · GPLv3 licence

Scroll to Top