[REMOTE] : Script de connexion VNC sur une connexion SSH
Par neoclimb,
jeudi 22 mars 2007 à 14:11 ::Linux::
Voici un petit script pour linux afin de vous connectez à une machine via VNC sur un tunnel SSH.
Créer votre fichier:
$ touch vnc_over_ssh.sh $ chmod 766 vnc_over_ssh.shCopier le script suivant dans le fichier vnc_over_ssh.sh
#!/bin/bash echo " " echo "*** vnc_over_ssh.sh script Must be run on LOCAL machine ***" echo " " echo "Enter Username's password, then VNC Server password..." echo " " DEST_HOST=www.votre-site.com # IP of SSH/VNC Server DEST_USER=votre_user # Username DEST_DISP=0 # Xvnc Desktop Number xhost + ${DEST_HOST} pgrep -f "ssh -C -L 15000:localhost:590${DEST_DISP} ${DEST_USER} ${DEST_HOST} -f /bin/sleep 10 " > /dev/null if [ $? != 0 ]; then ssh -C -L 15000:localhost:590${DEST_DISP} ${DEST_USER}@${DEST_HOST} -f /bin/sleep 10 echo ssh -C -L 15000:localhost:590${DEST_DISP} ${DEST_USER}@${DEST_HOST} -f /bin/sleep 10 fi vncviewer localhost:15000 -LowColourLevel 2 -AutoSelect=0 xhost - ${DEST_HOST}Pour l'exécuter taper:
$./vnc_over_ssh.sh
Commentaires
Aucun commentaire pour le moment.
Ajouter un commentaire
Les commentaires pour ce billet sont fermés.