Presents your JAVA E-NEWSLETTER for June 30, 2003 <-------------------------------------------> UTILIZE THE SSHTOOLS TOOLKIT With companies becoming more security conscious, some of them are disallowing plain-text applications like Telnet, rcp, rsh, and FTP and are switching to applications that use encryption like Secure Shell (SSH) and scp. One way to get a leg up when creating SSH applications is by utilizing the SSHTools project. SSHTools describes itself as "open source Secure Shell toolkits for Java."http://www.sshtools.com/ Even though you may have used SSH clients, have you ever needed to implement one? If you do need to implement an SSH client, then you may find the J2SSH API of the SSHTools project useful. (The J2SSH API is the SSH component of the toolkit.) This bit of code demonstrates making an SSH connection and retrieving the available authentication methods: import java.io.IOException; import java.util.Iterator; import java.util.List; import com.sshtools.j2ssh.SshClient; public class SshTip { public static void main(String[] args) throws IOException { SshClient ssh = new SshClient(); ssh.connect("localhost"); List methods = ssh.getAvailableAuthMethods("dave"); Iterator tor = methods.iterator(); while (tor.hasNext()) { String methodName = (String) tor.next(); System.out.println(methodName); } ssh.disconnect(); } } Execution of this code yields the following output: Publickey password keyboard-interactive Without the help of an API, creating even this simple example would have involved much more code. SSHTools isn't just an API. The toolkit comes with applications you can use on a daily basis. One example is the SSHTerm application, which is a full-blown SSH client that is comparable to commercially-available and popular SSH clients. SSHTools also includes a VNC application and an SSH daemon. If security is important to your business, then check out SSHTools. It gives you a significant head start when creating SSH applications. David Petersheim is a Senior Java Developer with Genscape, Inc. He designs and develops server-side applications to acquire and process real-time energy data. ----------------------------------------