1 / 9

Field Trip #28

Securing a VNC Connection with Java By Keith Lynn. Field Trip #28. Packages. A package is a collection of related classes The package we will use is called Jsch which can be downloaded from www.jcraft.org This package allows us to make secure connections using the SSH protocol

woodn
Télécharger la présentation

Field Trip #28

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Securing a VNC Connection with Java By Keith Lynn Field Trip #28

  2. Packages • A package is a collection of related classes • The package we will use is called Jsch which can be downloaded from www.jcraft.org • This package allows us to make secure connections using the SSH protocol • We will use SSH and tunnels to provide a secure connection for VNC

  3. JSch • The package Jsch contain classes necessary to create a secure connection • We create an instance of a Session which we create by using the username, host, and port • We then specify additional information • We set the property StrictHostKeyChecking to no so we don't get prompted with a question about storing the host when we connect • We also can specify which port should be tunneled

  4. VNC • VNC stands for Virtual Network Computing • It will essentially allow us to make a remote desktop connection • However, there is no real encryption of passwords • So we use SSH to tunnel VNC and this will provide a level of encryption

  5. JFrame • A JFrame is a top-level container • We can add other components to the JFrame • In this app, we will add labels, text fields, and a button • A JLabel allows us to put a label in the frame • A JTextField allows us to get input from the user • A JButton allows us to trigger an action

  6. Events • In order to detect and act on the button click, we will create an event listener • The event listener we will create is an ActionListener • ActionListener is an interface which contains the method actionPerformed • If the listener is registered with the button, then when the button is clicked, actionPerformed is called • We can get a reference to the source of the event with the method getSource()

  7. SSH • SSH is a secure communications protocol • It is a replacement for protocols like telnet which wasn't secure • In order to make the connection, we must have a server which accepts SSH connections and a client that can connect to the server

  8. Executing External Programs in Java • When we click the button, we want to execute an external program which will start a vnc viewer • In order to execute the program, we will use a ProcessBuilder • This class allows us to execute a remote command • We must make sure that connect to the ProcessBuilder's input stream and read all of it

  9. VncViewer • Vncviewer is a free utility that will allow us to connect to a VNC server • We specify the port that'd we've tunneled through SSH and use 127.0.0.1 as the hostname • If everything is connected correctly, you should see the desktop

More Related