Difference between revisions of "Remote Access to the Ubuntu Linux Desktop"
(→Establishing a Secure Remote Desktop Session from a Windows System) |
(→Establishing a Secure Remote Desktop Session from a Windows System) |
||
Line 83: | Line 83: | ||
Enter the IP address or host name of the remote host (or the external IP address of the gateway if you are connecting from outside the firewall). The next step is to set up the tunnel. Click on the + next to SSH in the ''Category'' tree on the left hand side of the dialog and click on Tunnels. The screen should appear as follows: | Enter the IP address or host name of the remote host (or the external IP address of the gateway if you are connecting from outside the firewall). The next step is to set up the tunnel. Click on the + next to SSH in the ''Category'' tree on the left hand side of the dialog and click on Tunnels. The screen should appear as follows: | ||
− | [[Image: | + | [[Image:putty_tunnels_screen.jpg]] |
Enter 5900 as the ''Source port'' and localhost:5900 as the ''Destination'' and click on ''Add''. Finally return to the main screen ny clicking on the ''Session'' category. Enter a name for the session in the ''Saved Sessions'' text field and press save. Click on ''Open'' to establish the connection. A termial window will appear with the login prompt from the remote system. Enter your user login and password credentials. | Enter 5900 as the ''Source port'' and localhost:5900 as the ''Destination'' and click on ''Add''. Finally return to the main screen ny clicking on the ''Session'' category. Enter a name for the session in the ''Saved Sessions'' text field and press save. Click on ''Open'' to establish the connection. A termial window will appear with the login prompt from the remote system. Enter your user login and password credentials. | ||
The SSH connection is now established. Launch the TightVNC viewer and enter localhost::5900 in the ''VNC Server'' text field and click on ''Connect''. The viewer will establish the connection, prompt for the password and then display the desktop. You are now accessing the remopte desktop of a Linux system on Windows. | The SSH connection is now established. Launch the TightVNC viewer and enter localhost::5900 in the ''VNC Server'' text field and click on ''Connect''. The viewer will establish the connection, prompt for the password and then display the desktop. You are now accessing the remopte desktop of a Linux system on Windows. |
Revision as of 17:55, 28 June 2007
Ubuntu Linux provides remote desktop access. This provides two extremely useful features. Firstly it enables you, or another person to view and interact with your desktop environment from another computer system either on the same network or over the internet. This is useful if you need to work on your computer when you are away from your desk while travelling or sitting in a coffee shop. It is also useful in situations where a co-worker or IT support technician needs access to you desktop to resolve a problem.
Secondly, in addition to providing access to your primary desktop (the one you see when you switch on your monitor every morning) it enables you to create multiple desktops and connect to them remotely.
The Ubuntu Linux remote desktop functionality is based on technology called Virtual Network Computing (VNC) and in this chapter we will cover the key aspects of configuring and using remote desktops with Ubuntu Linux. It is important to note that there both secure and insecure ways to access a remote desktop, and both approaches will be covered.
Activating Remote Desktop Access
The first step in setting up remote desktop access is to activate it and define some basic security settings. These settings are configured in the Remote Desktop Preferences dialog. The access this dialog open the desktop System menu, select Preferences and click on Remote Desktop. When slected the following window will appear:
In this dialog the following configuration options are available:
- Allow others to view your desktop - Activates remote desktop access for viewing purposes.
- Allow other users to control your desktop - Allows users accessing your remote desktop to control the desktop. In oterh words the remote user can do anything to your desktop that they want suing their mouse and keyboard as if they were sitting physically at the local system.
- Ask for confirmation - When selected, this option cause a dialgo to appear warning you of an attempt by a remote user to connect and prompting you to confirm or deny the connection. If you are likely to want to log in remotely you will need to turn this off since you will not be at the local system to accept your own connection.
- Require the user to enter this password - Specifies a password wich must be entered by the remote user to access your desktop. It is strongly advised that you select this option and specify a password.
Finally this screen specifies the command to run on the remote system to access the desktop. Once you have configureed Remote Desktop access you are ready to try connecting.
Accessing a Remote Ubuntu Linux Desktop
As mentioned previously there are both secure and insecure methods for accessing a remote desktop. In this section we assume that the desktop is being accessed by a remote system on the same local network where security is not a concern. See the section later in this chapter for estabishing a secure connection if you are connecting from a system outside your firewall.
Having configure the remote desktop settings on the local system move to another system on your network, open a terminal window and enter the command specified in the Remote Desktop Preferences dialog, for example:
vncviewer hostname:0
where hostname is either the hostname or IP address of the remote system.
if you you configure the remote system to prompt to approve a connection a dialog will appear on the remote system. Until the conenction is approved the vncview session will wait. Once approved, or if no approval is required, VNC will prompt for the password (assuming one was defined):
Enter the password and a new screen will appear containing the desktop from the remote system. If remote desktop control was enabled you can interact with the desktop as if you were sitting at the remote screen.
This section assumed that the remote desktop was being accessed from a Linux or Unix system. Access is also possible from a Windows system.
Accessing a Remote Ubuntu Linux Desktop from a Windows System
In order to access a Linux remote desktop from a Windows system the first step is to install a Windows VNC client on the Windows system. There are a number of VNC packages available for Windows. In this chapter we will look at TightVNC (http://www.tightvnc.com).
Download and install TightVNC on your Windows system. Once installed, launch the TightVNC Viewer and in the resulting Connection details dialog enter the IP address or hostname of the remote system and press OK. Enter the password if one is required. The screen should load and display the remote desktop,
You may also enter the port number in the form hostname::5900 (screen 0 in VNC uses port 5900). TightVNC assumes port 5900 if none is specified but when we look at setting up additional desktops later in this chapter we will need to specify port numbers in order to connect.
Establishing a Secure Remote Desktop Session
The remote desktop configurations we have explored so far in this chapter are considered to be insecure because no encryption is used. This is acceptable when the remote connection does not extend outside of an internal network protected by a firewall. When a remote session is required over an internet connection a more secure option is needed. This achieved by tunneling the remote desktop through a secure shell (SSH) connection.
Before a secure connection is established the SSH server must be installed in the desktop to which the connection is to be established. For detailed steps on installing the SSH server on an Unbuntu Linux system see Configuring Ubuntu Linux Remote Access using SSH.
Once the SSH server is installed and active it is time to move to the other system. At the other system, log in to the remote system using the following command, which will establish the secure tunnel between the two systems:
ssh -L 5900:localhost:5900 hostname
where hostname is either the hostname or IP address of the remote system. Log in using your account and password. The secure connection is now established and it is time to launch vncviewer so that it uses the secure tunnel. Leaving the ssh session running in the other terminal window, launch another terminal and enter the following command:
vncviewer localhost::5900
The vncviewer session will prompt for a password if one is required, and then launch the VNC viewer providing secure access to your desktop environment.
If you are connecting to the remote desktop from outside the firewall keep in mind that the IP address for the ssh connection will be the external IP address provided by your ISP, not the LAN IP address of the remote system (since this IP address is not visible to those outside the firewall). You will also need to configure your firewall to forward port 22 (for the ssh connection) to the IP address of the system running the desktop. It is not necessary to forward port 5900. Steps to perform port forwarding differ between firewalls, so refer to the documentation for your firewall, router or wireless base station for details specific to your configuration.
Establishing a Secure Remote Desktop Session from a Windows System
A similar approach is taken to establishing a secure desktop session from a Windows system. Assuming that you have a VNC client installed (as described above) the one remaining requirement is a Windows ssh client. A populuar ssh client for Windows is (PuTTY).
Once PuTTY is donwloaded and installed the first step is to set up a secure connection between the Windows system and the remote Linux system with appropriate tunnelling configured. When launched PuTTY displays the following screen:
Enter the IP address or host name of the remote host (or the external IP address of the gateway if you are connecting from outside the firewall). The next step is to set up the tunnel. Click on the + next to SSH in the Category tree on the left hand side of the dialog and click on Tunnels. The screen should appear as follows:
Enter 5900 as the Source port and localhost:5900 as the Destination and click on Add. Finally return to the main screen ny clicking on the Session category. Enter a name for the session in the Saved Sessions text field and press save. Click on Open to establish the connection. A termial window will appear with the login prompt from the remote system. Enter your user login and password credentials.
The SSH connection is now established. Launch the TightVNC viewer and enter localhost::5900 in the VNC Server text field and click on Connect. The viewer will establish the connection, prompt for the password and then display the desktop. You are now accessing the remopte desktop of a Linux system on Windows.