SSH access to Telecom ParisTech

This tutorial works on my Debian Stretch installation. It allows to connect to a computer at Telecom ParisTech in a “salle de TP”. It should work on recent Unix-like OS given you installed the required packages. You can skip the “One time preparation” if you want to type in your password every time.

[Link to official mention of SSH access.]

One time preparation

Add the following lines to file ~/.ssh/config

Host tpt
	User <YOUR_USERNAME>
	Hostname ssh.enst.fr
	ServerAliveInterval 30
	ServerAliveCountMax 120
	ForwardX11Trusted yes

# Optional, useful if you know the on/off state of a certain computer 
Host c1*
	ProxyCommand ssh tpt -W %h:%p
	User <YOUR_USERNAME>
	ForwardX11Trusted yes

Host *
	Compression yes

Copy your ssh public key to Télécom (if you don’t have one, generate it with ssh-keygen)

$ ssh-copy-id tpt

Establish a SSH connection

Connect to TPT and check for running machines

$ ssh tpt
....
$ ~rebele/multiping.sh
c125-01 is up
c125-02 is up
...
$ ssh c125-01

Script to check for running machines

The script multiping.sh has the following content (You can alternatively create a shell script with the following content in your home directory):

#!/bin/bash

set +m

iping() {
  ping -c 1 $1 &> /dev/null && echo "$1 is up"
}

if [ "$#" == 0 ]; then
  lst=c{125..130}-{00..30}
else
  lst=$*
fi

lst=$(eval echo $lst)

for ip in $lst; do iping $ip & done

sleep 0.25
echo "press key"
read