Virtual classroom by sharing terminal over ssh using screen

In today’s world, all learning methods are based on remote locations. Considering the case with GNU/Linux, remote learning on topics like System Administration, Networking etc involves the execution of different commands from shell. Mere writing these commands in a tutorial sheet and passing it over does not make sense. Then what else we can do? Good question. Take an example of a Mathematics classroom. There students could see what are the different steps that teacher is performing inorder to solve various problems via white board/black board. Here this board will be placed in a position to be seen by everyone inside the classroom. How can we make use of the SCREEN tool in the light of above mentioned example?

What is screen?
Screen  is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). When screen is called, it creates a single window with a shell inside it. Everything you type is sent to the program running in the current window.

How can I share using screen?
In order to share the terminal, first make sure that you have the screen tool installed on your system. Remember the classroom example? Place yourself in the position of teacher. But here the classroom is virtual and thereby your students are seated at remote locations. In this particular session you are told to teach your students some shell commands, by viewing and analyzing various results. First of all create a screen session as explained below

# screen -S <session_name>

Now a screen session will be created with the specified name. Verify the same by listing the available screen sessions

# screen -ls

Suppose a student has ssh access to this particular system under a different login ID. Note that by default no password is set for newely created screen sessions. So anyone with ssh access to the system can join the session by issuing the following command

# screen -x <session_name>

That’s it and you are done. Now whatever you type on your screen will be displayed over ssh on the other side as well. In order to terminate the current screen session, just type exit and you are out.

So what do you feel? Was that helpful? If so, how can I restrict access to those screen sessions for specified students? Here is what you can do. After creating the screen session press Ctrl-a to enter into command mode and type

:multiuser on

Then Multi user mode will be enabled. Now add each student as follows [by pressing Ctrl-a first]

:acladd <loginID>

To allow only read access to a particular student ID,

:aclchg <logiinID> -w “#”

Try exploring more from the man page of screen command and I am sure you will get excited towards its immense features.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s