Setting Up VNC, SSH Tunnels, and RDP



Similar documents
CONNECTING TO DEPARTMENT OF COMPUTER SCIENCE SERVERS BOTH FROM ON AND OFF CAMPUS USING TUNNELING, PuTTY, AND VNC Client Utilities

Using Virtual Machines

Author A.Kishore/Sachin VNC Background

How. to: Connect Remotely. Updated by

Adafruit's Raspberry Pi Lesson 7. Remote Control with VNC

Installing an IBM Workplace/Portal Server on Linux

PuTTY/Cygwin Tutorial. By Ben Meister Written for CS 23, Winter 2007

Instructions for Accessing the Advanced Computing Facility Supercomputing Cluster at the University of Kansas

RSA SecurID Token User Guide February 12, 2015

Getting the most out of your new Aalto workstation An Aalto IT guide for personnel migrating to the new Aalto workstation environment

Installation Guidelines (MySQL database & Archivists Toolkit client)

MATLAB on EC2 Instructions Guide

Check current version of Remote Desktop Connection for Mac.. Page 2. Remove Old Version Remote Desktop Connection..Page 8

Introduction to Operating Systems

You can find a lot of great resources on the internet for setting up VNC on Linux!

University of Wisconsin System Shared Financial System (SFS) PeopleTools 8.53 Client Setup Guide

Connecting to the Remote Desktop Service

ILTA HANDS ON Securing Windows 7

freesshd SFTP Server on Windows

Cloud Server powered by Mac OS X. Getting Started Guide. Cloud Server. powered by Mac OS X. AKJZNAzsqknsxxkjnsjx Getting Started Guide Page 1

Global Knowledge European Remote Labs Accessing the Remote Labs portal from Windows

The initial set up takes a few steps, but then each time you want to connect it is just a two set process.

SSH and Basic Commands

Setting up VNC, SAMBA and SSH on Ubuntu Linux PCs Getting More Benefit out of Your Local Area Network

How to Use? SKALICLOUD DEMO

A-AUTO 50 for Windows Setup Guide

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

Hosting Users Guide 2011

VeloView Offline GUI

Windows and MAC User Handbook Remote and Secure Connection Version /19/2013. User Handbook

Installing Microsoft Outlook on a Macintosh. This document explains how to download, install and configure Microsoft Outlook on a Macintosh.

Connecting to Remote Desktop Windows Users

Setting up VPN and Remote Desktop for Home Use

DISTRICT SCHOOL BOARD OF COLLIER COUNTY. Internet Technology. Setting up VPN Access Windows 7. Revised

Tutorial Guide to the IS Unix Service

How to Setup and Connect to an FTP Server Using FileZilla. Part I: Setting up the server

Remote Access to Unix Machines

Setting up Hyper-V for 2X VirtualDesktopServer Manual

SSL VPN Setup for Windows

This manual provides information and instructions for Mac SharePoint Users at Fermilab. Using Sharepoint from a Mac: Terminal Server Instructions

Contents. VPN Instructions. VPN Instructions... 1

Microsoft Entourage 2008 / Microsoft Exchange Server Installation and Configuration Instructions

DESKTOP CLIENT CONFIGURATION GUIDE BUSINESS

Livezilla How to Install on Shared Hosting By: Jon Manning

UBC Digital Signage Service: CoolSign 5.0 Initial Set- up Guide

IPRO Viewer. Installation

1. Open the preferences screen by opening the Mail menu and selecting Preferences...

Setting up VMware Server v1 for 2X VirtualDesktopServer Manual

Installing Java 5.0 and Eclipse on Mac OS X

Mac OS X: INSTALLING TUNNELBLICK

Quick Connect. Overview. Client Instructions. LabTech


Setting Up a Backup Domain Controller

Securing Windows Remote Desktop with CopSSH

Using Remote Desktop with the Cisco AnyConnect VPN Client in Windows Vista

Quick Start Guide for Parallels Virtuozzo

Using Remote Desktop to access your Office Computer or Faculty Remote Desktop Server August, 2005 This document consists of two main parts and an

Visualization Cluster Getting Started

QUANTIFY INSTALLATION GUIDE

IIS, FTP Server and Windows

Freshservice Discovery Probe User Guide

Remote Desktop In OpenSUSE 10.3

Shellshock Security Patch for X86

Setting up VMware ESXi for 2X VirtualDesktopServer Manual

EVault Software. Course 361 Protecting Linux and UNIX with EVault

Securing Windows Remote Desktop with CopSSH

2X SecureRemoteDesktop. Version 1.1

Remote Desktop Administration

2X ApplicationServer & LoadBalancer Manual

Download and Install the Citrix Receiver for Mac/Linux

SSH Connections MACs the MAC XTerm application can be used to create an ssh connection, no utility is needed.

Initial Setup. How To Run A Mac Server:

Accessing SSL VPN with Mac OS X

Windows Clients and GoPrint Print Queues

Setting up Sharp MX-Color Imagers for Inbound Fax Routing to or Network Folder

Enterprise Apple Xserve Wiki and Blog using Active Directory. Table Of Contents. Prerequisites 1. Introduction 1

CHARTER BUSINESS custom hosting faqs 2010 INTERNET. Q. How do I access my ? Q. How do I change or reset a password for an account?

Deploying BitDefender Client Security and BitDefender Windows Server Solutions

Transitioning from TurningPoint 5 to TurningPoint Cloud - LMS 1

Apple Mac VPN Service Setting up Remote Desktop

Windows Server 2008 R2 Initial Configuration Tasks

Virtual Office Remote Installation Guide

1. Open the preferences screen by opening the Mail menu and selecting Preferences...

How to Use Remote Desktop over a Secure Connection (SSH)

AppLoader 7.7. Load Testing On Windows Azure

Disabling Microsoft SharePoint in order to install the OneDrive for Business Client

Service & Support. How do you create a communication of VNC with an Industrial Thin Client SIMATIC ITC? Thin Client.

Phone: Fax: Box: 230

NeoRouter for Android

Setting up Hyper-V for 2X VirtualDesktopServer Manual

1. Set Daylight Savings Time Create Migrator Account Assign Migrator Account to Administrator group... 4

Using Remote Desktop with No-IP

How do I Install and Configure MS Remote Desktop for the Haas Terminal Server on my Mac?

Setting up RDP on your ipad

Optional Mainserver Setup Instructions for OS X Support

MATLAB Distributed Computing Server with HPC Cluster in Microsoft Azure

TAMUS Terminal Server Setup BPP SQL/Alva

Campus VPN. Version 1.0 September 22, 2008

Setting up VPN and Remote Desktop for Home Use

Transcription:

Setting Up VNC, SSH Tunnels, and RDP Thomas Pepler April 25, 2016 If you have suggestions for improving this document, please email them to: tpepler@doe.carleton.ca Contents 1 Connecting to DOE Linux Machines with PuTTY 2 1.1 Download and Setup PuTTY.......................... 2 1.2 Configure PuTTY with DOE Connection Settings.............. 2 1.3 Start an SSH Session............................... 2 2 Setting up a VNC Session 2 2.1 Preparation.................................... 3 2.2 Creating Your VNC Password.......................... 4 2.3 Changing the Default Desktop Environment and Other Settings....... 4 2.4 Creating a New VNC Session.......................... 5 2.5 Listing Your VNC Sessions........................... 5 2.6 Killing a VNC Session.............................. 6 3 Adding an SSH Tunnel for Your VNC Session 6 3.1 Find an Available Port to Use For Tunneling................. 6 3.2 Add an SSH Tunnel to Your VNC Port.................... 7 4 Using a VNC Viewer to Access the VNC Session 8 4.1 Download, Install, and Run a VNC Viewer.................. 8 4.2 Launch PuTTY and Log In to the SSH server (if not on the DOE network / off campus)................................... 8 4.3 Open the VNC Session.............................. 10 5 Adding and using SSH Tunnels for RDP (Windows machines) 10 5.1 Adding the Tunnel................................ 11 5.2 Connecting to the Remote Machine....................... 11 Page 1 of 13

1 Connecting to DOE Linux Machines with PuTTY 1.1 Download and Setup PuTTY 1. If you do not already have PuTTY installed on your computer, then go to the following link, download and install a copy of PuTTY (on Windows OS, I recommend using the Installer executable). http://www.chiark.greenend.org.uk/ sgtatham/putty/download.html 1.2 Configure PuTTY with DOE Connection Settings 1. The easiest way to configure PuTTY is to download the Windows registrey keys available from the Department of Electronics (DOE) website, here. (If this link is broken let me know.) Alternatively, in PuTTY set the Host Name, Port, and Connection Type to those shown in figure 1. Then save these settings by typing a name in the Saved Sessions field (the instructions assume it was doe ) and click Save. You can then skip the remaining steps in section 1.2. 2. Find where you saved the file and double-click it, this should automatically add the keys to your Windows Registry. The next time you run PuTTY there should be a saved session named doe (see figure 1). 3. Load all the settings for the saved session by selecting the name and click Load. 1.3 Start an SSH Session 1. At the bottom of the Sessions setup page, click Open. 2. If this is the first time logging in to this server, you may be asked to add a security key for it; choose Yes to store the key and you will not get this warning next time. 3. A command prompt should pop up. Enter your DOE username and password at the prompts. From the SSH server prompt, you can ssh to other Linux machines to run CAD tools, or to start a VNC session. 2 Setting up a VNC Session This section describes how to use your local Windows machine to set up a remote VNC session that runs on the DOE Linux machines. The advantage of using VNC is that the session remains running even after the connection to it has closed (i.e. your applications remain open even after you close the VNC viewer). Page 2 of 13

Figure 1: An example of PuTTY with saved sessions, showing the doe saved session. 2.1 Preparation 1. Log in to the Linux server on which you want to create a VNC session. If necessary, open a terminal. If you are using PuTTY, and followed the instructions in section 1, at this point you will have to enter ssh <server you want your VNC session on>, e.g.: ssh odin. You should now be ready to type commands at the prompt. Note: I have tried to stick to the following conventions related to using terminal commands: when asked to enter something at the prompt, this means type it and then push Enter or Return on the keyboard; when directed to type something, this means to type it, but omit the Enter or Return. Page 3 of 13

2.2 Creating Your VNC Password The first and most important thing to do is create a password (not only for your own protection, but anyone else who uses the machine). 1. At the prompt, enter vncpasswd. You will be directed to enter the password (no characters get echoed to the terminal while you enter your password), and then enter it again to verify against any typos. 2. If everything worked fine, you will be back at the prompt and your VNC session logins are now secured with a password. An example: odin ( tpepler ): ~ $vncpasswd Password : Verify : odin ( tpepler ): ~ $ 2.3 Changing the Default Desktop Environment and Other Settings If you have never run VNC before, then your xstartup script will not exist in your.vnc directory yet. In that case, skip to section 2.4 to make a dummy session causing the creation of your xstartup file, then section 2.6 to kill the session, then return here to change some of the default settings. 1. To get the gnome desktop environment to load when you create your VNC session, uncomment the two lines at the top of the xstartup script just after the comment Uncomment the following two lines for normal desktop. Use any text editor to do this, but the easiest might be: nano ~/.vnc/xstartup, you can replace nano in the command with vi, gedit, or your own preferred editor. 2. While you ve got the xstartup script open, you may as well make another change. To allow copy/paste from the VNC viewer window to the client (e.g. Windows) machine, add the line vncconfig -nowin & before the two lines you just uncommented. In general, for vncconfig to work it must be called before the desktop environment startup (in this case, before those two lines). 3. Save the file. Your xstartup should now look similar to this: #!/ bin /sh # allow copy / paste, but do not pop up a window : vncconfig - nowin & Page 4 of 13

# Uncomment the following two lines for normal desktop : unset SESSION_ MANAGER exec / etc / X11 / xinit / xinitrc [ -x / etc / vnc / xstartup ] && exec / etc / vnc / xstartup [ - r $HOME /. Xresources ] && xrdb $HOME /. Xresources xsetroot - solid grey # xterm - geometry 80 x24 +10+10 - ls - title " $VNCDESKTOP Desktop " & 2.4 Creating a New VNC Session 1. Everything should now be set up, so start a new VNC session with a specific resolution and colour depth as follows (note: 24-bit colour is required for some CAD programs, e.g.: Cadence Virtuoso): odin ( tpepler ): ~ $vncserver - depth 24 - geometry 1920 x1080 New odin. doe. carleton.ca :9 ( tpepler ) desktop is odin. doe. carleton.ca :9 Starting applications specified in / home / tpepler /. vnc / xstartup Log file is / home / tpepler /. vnc / odin. doe. carleton.ca :9. log odin ( tpepler ): ~ $ 2. The first line that is printed by the vncserver program tells you which server and display number is associated with this new VNC session. In the example above, the server is odin.doe.carleton.ca and the display is 9. Take note of these, as you will need them to connect using your VNC viewer or when creating an SSH tunnel. 2.5 Listing Your VNC Sessions 1. The vncserver program maintains a set of files in your.vnc directory for each VNC session you have created. Currently running sessions are the files with a.pid extension, so to list your currently running sessions type ls ~/.vnc/*.pid. e.g.: odin ( tpepler ): ~ $ls ~/. vnc /*. pid / home / tpepler /. vnc / loki :3. pid / home / tpepler /. vnc / odin. doe. carleton.ca :11. pid / home / tpepler /. vnc / loki :4. pid / home / tpepler /. vnc / odin. doe. carleton.ca :9. pid Page 5 of 13

/ home / tpepler /. vnc / loki :6. pid / home / tpepler /. vnc / oslo. doe. carleton.ca :1. pid odin ( tpepler ): ~ $ 2.6 Killing a VNC Session From time to time, you may need to close your VNC session (e.g. a program has locked up and you can t recover). To do this, you need to know the server and VNC display number. 1. SSH in to the server using PuTTY, as outlined in section 1 and section 2.1. You must be SSH d (or logged in somehow) to the server with the VNC session you want to kill. 2. Now issue the command vncserver -kill :<display number to kill>. For example, if I wanted to kill my odin:11 session: ssh ( tpepler ): ~ $ssh odin tpepler@ odin s password : odin ( tpepler ): ~ $vncserver - kill :11 Killing Xvnc process ID 7881 odin ( tpepler ): ~ $ 3 Adding an SSH Tunnel for Your VNC Session This section describes how to use an SSH tunnel to access your VNC session from outside the DOE network (e.g. somewhere else on campus, or off campus completely). 3.1 Find an Available Port to Use For Tunneling 1. On your Windows machine, open cmd.exe by: (a) Using the Start menu search to find a program called cmd.exe ; or (b) type [Windows key]+r to open a run dialog, and enter cmd. 2. At the cmd prompt enter netstat -ano find "<port_number>". For the <port_number> you can put any number, but I suggest sticking to 4-digit numbers; 1234 seems to be open on most systems. 3. If the command returns nothing, then the port is available for your use (make a note of the number to use in a later part of the instructions). If the port is already being used, the command will return some information about the port. An example of the command first for an unused port number, then a used port number are shown in figure 2. Page 6 of 13

Figure 2: Example of finding an open ( 1234 ) and used ( 1972 ) port. 3.2 Add an SSH Tunnel to Your VNC Port 1. If you have the PuTTY prompt already open, click on the icon in the top left corner of the window (see figure 3) and choose Change Settings..., if you ve just started PuTTY but not opened a connection, make sure you ve loaded the settings for doe first (check that the Host Name and Port fields are set correctly). Either way, you should now see a PuTTY configuration window like that shown in figure 1. 2. On the navigation panel on the left, expand (if needed) Connection, and then SSH, then select Tunnels (you may need to scroll down). 3. In the Source port field, type in the open port you found in section 3.1. In the Destination field type in the server and port in the format <server>:<port> ; for VNC ports, the port number is calculated as [5900] + [display number] (remember the one I told you to note down in section 2.4?). 4. Make sure the Local and Auto radio buttons are selected, then click Add to add this tunnel to the list. See figure 4 for an example. Page 7 of 13

Figure 3: The PuTTY window icon to access the Change Settings form. 5. Now select the Session category on the left pane of the PuTTY window, click doe and choose Save to save the setting you just changed (i.e. added a tunnel). 6. Finally, choose Apply at the bottom to apply the changes. 4 Using a VNC Viewer to Access the VNC Session 4.1 Download, Install, and Run a VNC Viewer If you already have a VNC viewer installed, that should be fine, if not, RealVNC offers a nice one. 4.2 Launch PuTTY and Log In to the SSH server (if not on the DOE network / off campus) If you were following the tutorial so far, PuTTY should already be running and logged into the DOE. Each time you want to access your VNC session from off-campus, you will have to first launch PuTTY and log in as described in section 1.3. If you are on campus Page 8 of 13

Figure 4: Adding a new SSH tunnel. Page 9 of 13

Figure 5: Entering the server in the VNC Viewer dialog. and connected to the DOE network, SSH tunneling (e..g. through PuTTY) should not be needed. 4.3 Open the VNC Session 1. If you are on campus and connected to the DOE network, open the VNC Viewer program and in the server field enter <server>:<display number> (e.g. odin:9 as per the example from section 2.4). 2. If off campus (or not connected to DOE directly), make sure you have PuTTY running and logged in, then in the server field enter localhost::<local port>, where <local port> is the Local port you entered in section 3.2, e.g. see figure 5. 3. Finally, click Connect, if you get a warning about this being an unencrypted connection just continue anyway (and you can opt to not have the warning again), next you should be prompted to enter the password that you set earlier, if that works your VNC session should pop up. 5 Adding and using SSH Tunnels for RDP (Windows machines) An alternative to VNC is Remote Desktop Protocol (RDP), and is what you would use to access most machines running the Windows OS, e.g. the VLSI Windows servers maintained by Nagui, or your office computer (if it s running Windows). The corresponding viewer, Remote Desktop Connection, is usually installed by default on Windows; it is also available for Mac OS X, and there are equivalents for Linux (and probably other OSes). Page 10 of 13

The process for using SSH tunnels to allow RDP access is basically the same as for VNC, as shown below. 5.1 Adding the Tunnel 1. The default port for RDP is 3389 (although this can be changed by the administrator; maybe there s a way to find what it is, please let me know if you find out how). 2. Follow the same steps as in 3.1 and 3.2, except the destination port should be 3389 (or whatever else, if not the default), e.g.: 134.117.38.203:3389. Note: For the VLSI servers maintained by Nagui, you will have to use the IP address rather than the machine name, as the DNS does not seem to be configured for them. Following is a list of the server names and corresponding IPs: Server IP address Rami 134.117.38.25 Marianne 134.117.38.41 macopeland 134.117.38.70 Tewfik 134.117.38.186 Michel 134.117.38.193 Sobhi 134.117.38.195 Galal 134.117.38.196 Marie 134.117.38.203 eli 134.117.38.204 Mounir 134.117.38.207 gabrielle 134.117.38.242 knight 134.117.38.243 gisele 134.117.39.81 Celine 134.117.38.68 Celine (using IPv6) fe80::716a:8e3e:e63:454b * IPv6 addresses like that shown are only supported in the latest (nightly) builds of PuTTY, and should be included in PuTTY 0.65, when it s released (I assume). You would need to surround the address in square brackets, e.g.: [fe80::1c90:cc21:63ad:da42]:3389. After trying all of that, it was still not working for me, let me know if you have any success. 5.2 Connecting to the Remote Machine 1. Open Remote Desktop Connection, and in the Computer field, type localhost:<local port number>, e.g. if I used port number 2345, that would be localhost:2345 (see figure 6). Page 11 of 13

Figure 6: Example screenshot of Remote Desktop Connection for a tunnel through local port 2345. 2. Before connnecting, you can adjust display options by clicking Show Options, and then the Display tab (see figure 7). Here you can adjust the screen resolution of the remote session by dragging the slider. You can also use all monitors (if you have more than 1), by checking Use all my monitors... (although this may not work depending on the version of Windows running on the remote machine). As well, you can change the colour depth (24-bit is recommended since some programs cannot run with less). 3. After making any changes, click Connect and you should be prompted to enter your username and password. You have to make sure your username also includes the correct domain, in the format of <domain>\<username>, e.g. vlsi1\tpepler. The VLSI servers use the domain name of vlsi1 while any of the DOE computers have the domain of doe.carleton.ca. Page 12 of 13

Figure 7: Example screenshot of Remote Desktop Connection display options. Page 13 of 13