This week's book giveaway is in the Performance forum. We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line! See this thread for details.
I am trying to write a java program and eventually a web app to do the following.
1. get the server name, username, password from the user and ssh to the linux box.
2. goto a folder, open a script file (the file has different function calls, I need to comment all other function calls and just un-comment the one I want to use)
I know it should always use the call_2 for this, but other programs or users can comment/uncomment these calls. So I need to make sure of it.
3. Execute the nohup command to run the script
4. May be (this is to be decided) send an email once its done.
I think we can do this from a java program, but not sure about the step 2. Do we need a script for that?
I started using JSch - Java Secure Channel, but I get "com.jcraft.jsch.JSchException: Auth fail". I found that I need to change /etc/ssh/sshd_config file. But for me that is not an option because of compliance issues. So how else can I go about this.