Will there be any other teachers with courses on same server?
Cockpit provides a standard shell in a terminal. This shell and the processes running in it have the same privileges as if the user had logged in via SSH.
I imagine all one would have to do then is find a way to link to Cockpit/Terminal from Moodle.
'Test commands ... ' like what ... specifically.
On your current moodle set up another user (hpotter in example below) with only a shell account.
Login as that user or as root su -l username
[hpotter@server ~]$ echo $PATH
Hmmmm ... if hpotter was the curious sort, right after he learned how to list a directory, what would hpotter see if listing /usr/bin/? What could hpotter execute from /usr/bin/?
*** note this is a CentOS 7 box with no special considerations/restrictions other than what the OS provides ... notice the .local/bin/ directory?
'spirit of sharing', Ken
In coordination with Server Admins and a Teacher, 20 years ago setup a linux box for students to learn how to publish web pages via editors like the one in Netscape Communicator, or DreamWeaver, or Front Page back then.
For the most part, entity had students who could be trusted. One student loved cars ... any kind ... and his thing was to find pictures of cars. He must of found the 'mother load' of such images, cause in short order this one student had filled up all available space on server ... yes, there was no quota set per user.
Good thing server was internal only ... and didn't run anything else for other teachers ... using things like Moodle ... full hard drive meant MySQL could not be launched ... no one could login to the moodle, etc., etc.