GeeCON Prague 2014*
The moose likes Security and the fly likes programmatic way for SSH Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » Security
Bookmark "programmatic way for SSH" Watch "programmatic way for SSH" New topic
Author

programmatic way for SSH

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Hi
We use Putty(SSH) to connect to one intermediate UNIX server.From this server we use Telnet to connect to production UNIX server to see the logs.Is there any better programmatic way to pass these credentials ? Basically checking the logs in browser is better than seeing unformatted logs on black UNIX screen!!


MH
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
yea, a simple servlet to do a tail operation on a log file, such that refreshing the page would re-run the tail.
but that would mean deploying a servlet container, or other script engine, on the machine where the logs are, and woud require the URL to this log viewer probably be secure, and assume the machine with the logs is even on the network in a way that http requests on some off beaten path port to view logs on is possible. and another problem if the log file (e.g. apache) is used for the application and this log viewer applet, then requests to view the logs will show up in the logs (what I call the 'fridge light problem').

but basically , in theory a general fie tailer might look like


and this could even be invoked from a JSP page, or a servlet


it would be really cool to extend this into an ajax driven auto refresh mechanism.


Error: Keyboard not attached. Press F1 to continue.
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Thanks for the help.
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Is there any API to pass SSH/Telnet parameters programmatically?So that servlet can connect to production server?
In Putty, i don't see any java api.
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
Here are a couple projects I know of that might help for this.

for ssh, the "jsch" project
http://sourceforge.net/projects/jsch/

and for telnet the commons-net project
http://commons.apache.org/net/
 
GeeCON Prague 2014
 
subject: programmatic way for SSH