LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Closed Thread
  Search this Thread
Old 08-12-2010, 03:38 PM   #1
vjy
Member
 
Registered: Oct 2004
Posts: 31

Rep: Reputation: 0
Java program sshing to Linux Server


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)

#call_1
call_2
#call_3
#call_4

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 have posted the same question in another forum.

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.

Any help is appreciated. Thanks.
 
Old 08-12-2010, 08:23 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread has been reported for closure because it is a duplicate.


http://www.linuxquestions.org/questi...t-help-825878/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Program In Linux Sunild21 Linux - Newbie 3 10-05-2009 06:12 AM
SSHing to server behind NAT? genmaicha Linux - Networking 7 04-17-2009 12:50 AM
a question about Java program on Linux jpan Programming 5 01-11-2005 06:05 PM
Problem calling linux program from Java spasco Programming 3 04-25-2004 12:13 AM
compiling a java program on server using servlet? raghutv Programming 1 03-15-2003 06:17 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration