Skip to content

Instantly share code, notes, and snippets.

@sblack4
Created June 9, 2018 17:06
Show Gist options
  • Select an option

  • Save sblack4/72e50980cbf9c36ca0a2bece728b0202 to your computer and use it in GitHub Desktop.

Select an option

Save sblack4/72e50980cbf9c36ca0a2bece728b0202 to your computer and use it in GitHub Desktop.
ssh command for vnc
#!/bin/bash
echo "... sshing to vncserver once we get some info ..."
echo "enter ip e.g. 123.456.789"
read HOST_IP
echo "enter username e.g. ubuntu"
read USERNAME
echo "key file, e.g. myPrivateKey"
read keyfile
echo "enter port"
read PORT
ssh $USERNAME@$HOST_IP -i $keyfile -L $PORT:$HOST_IP:$PORT -N -f -l $USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment