Connecting from home with Windows . . . to a MacOS office computer

Note: Before attempting to connect, make sure you've properly configured your Windows office computer and that you've installed the necessary software on your home computer.

  1. Connect to the VPN by clicking on the OpenVPN icon on your desktop or in your start menu.
    OpenVPN icon


  2. In the OpenVPN Client window, type in vpn.salina.k-state.edu and click Connect.
    OpenVPN desktop connect


  3. Enter your eID and password and click login.
    OpenVPN desktop login


  4. Once a successful connection has been made you should see a window similar to the one below:
    OpenVPN desktop success


  5. Use PuTTY to establish an SSH tunnel:
    1. Launch PuTTY ( Start > Programs > PuTTY > PuTTY )
    2. In the left-hand pane, expand Connection > SSH > Tunnels
    3. Check "Local ports accept connections from other hosts".
    4. Check "Remote ports do the same".
    5. In the "Source Port" window, type in 5901.
    6. In the "Destination" window, type in 127.0.0.1:5901.
    7. Click Add.
      PuTTY SSH tunnel configuration


    8. In the left-hand pane, scroll to the top and select Session.
    9. In the "Hostname" box, type in the IP address or DNS name of your work computer (usually the same as your eID) - eg. jsmith.salina.k-state.edu
    10. In the "Saved Sessions" box, type in a name for the connection - eg. jsmith VNC tunnel
    11. Click Save.


  6. Launch VNC Viewer (there should be a shortcut on your desktop or in your start menu if you installed it properly)


  7. In the connection details window, enter 127.0.0.1:5901 and click OK.
    VNC viewer login


  8. If you configured your office computer with a VNC login, you will be prompted for a password to connect.

Using a script to automate the connection process:

It is possible to use a script to automate the process of opening up the SSH tunnel and then launching VNC to connect, but doing so requires some understanding of how SSH tunneling and VNC work. Some basic information is provided below - if you're uncomfortable with using a script or do not understand the instructions listed below, please use the standard instructions listed above.

The commands below require the plink.exe program (part of PuTTY), VNC Viewer, and Sysinternals pskill.

  • plink command to open an SSH tunnel:

    start /MIN plink -ssh -P {remote SSH port} {remote IP/DNS name} -l {SSH username} -pw {SSH password} -C -v -batch -L {local port}:127.0.0.1:{remote port} -T -N

  • plink command to start OSXvnc-server remotely:

    start /MIN plink -ssh -P {remote SSH port} {remote IP/DNS name} -l {SSH username} -pw {SSH password} -C -v -batch -L {local port}:127.0.0.1:{remote port} /Applications/Vine\ Server.app/OSXvnc-server -rfbport {remote port} -desktop administrators-iMac -rfbnoauth -localhost -alwaysshared -restartonuserswitch N -UnicodeKeyboard 0 -keyboardLoading N -pressModsForKeys N -EventTap 3 -EventSource 2 -swapButtons -rendezvous N

  • vncviewer command to connect via an establish SSH tunnel:

    {path to vncviewer.exe} 127.0.0.1::{local port}

  • plink command to kill OSXvnc-server remotely:

    start /MIN plink -ssh -P {remote SSH port} {remote IP/DNS name} -l {SSH username} -pw {SSH password} -C -v -batch -L {local port}:127.0.0.1:{remote port} killall OSXvnc-server

  • command to kill plink.exe instances:

    pskill /accepteula plink.exe

 

This script provides one example of how these commands can be put together to automate the connection process.