I've written a Servlet that uses the library ganymed-ssh2-build210.jar (it uses these classes: import ch.ethz.ssh2.Connection; import ch.ethz.ssh2.Session; import ch.ethz.ssh2.StreamGobbler;) to run commands over an SSH connection (for test purposes it connects to my local machine). When I run my class as a standalone app it works, but when I deploy it into Tomcat and Tomcat starts it up as a Servlet, I get this exception (I've cut off the end, as I figured it probably wasn't relevent, but I can include it all if that would help):
java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:22 connect,resolve)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
at java.net.Socket.connect(Socket.java:513)
at ch.ethz.ssh2.transport.TransportManager.establishConnection(TransportManager.java:340)
at ch.ethz.ssh2.transport.TransportManager.initialize(TransportManager.java:448)
at ch.ethz.ssh2.Connection.connect(Connection.java:643)
...
Is this perhaps something to do with security policies? If so, do you know how I change them?
I'm using Java 1.6 and Tomcat6.