- Via SSH TCP/IP connections can be tunneld=forwarded.
- This behave like a poor man VPN solution.
- Advantage: together with private/public SSH key setup, this is very handy and scriptable.
- Example for using maple with a license server at ZI:
#!/bin/bash
#
# Starts a port forward from localhost:27002 to $LICENSE_SERVER:27002
# Starts maple with a temproray config file.
#
SSH_USER=<your account at IMATH>
SSH_SERVER=ssh.math.uzh.ch
LICENSE_SERVER=<ask IT>
PORT=27002
# Check if there is an old port forward running:
OLD_PID=`ps -ef | grep $PORT:$LICENSE_SERVER | grep -v $$ | awk '{ print $2 }'`
[ ! -z "$OLD_PID" ] && kill $OLD_PID
# Start port forward
ssh -f -N -L $PORT:$LICENSE_SERVER:$PORT $SSH_SERVER
LIC=`mktemp`
echo -e "SERVER localhost ANY $PORT\nUSE_SERVER" > $LIC
xmaple -f $LIC $@
rm $LICCopy the content to ~/xmaple.sh.
- Put in your IMATH username in line 3.
Make it executable chmod +x ~/xmaple.sh.
Start it via ~/xmaple.sh.