Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

running Java program as an agent

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have to do some operations on a remote machine. we used to ssh to connect to the remote host and do the operations. but now the client does not want to use SSH to connect. He wants to have an agent running which will listen to all the commands we send from our hosts, and perform the required operations. Is there any way this can be achieved.

This is what i think can be done.

I have written a web service in java and have packaged them in war. now i want to install this war as a service on the remote host, so that the web service end points are active on the host. all i will do is to send some messages to these listener end points and then run commands on the host.

I am not sure if it is even possible. Can some one point me to any appropriate link, or books if any.


 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course it is possible.

My advice - take things one step at a time, design components that can be tested and debugged separately. For example, the component that executes arbitrary commands or a mockup of the web service (with copious security and error reporting of course).

Each component will use well known tools so there is no need for a specialized book.

Bill

 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ashwin Raghavan wrote:Hi

I have to do some operations on a remote machine. we used to ssh to connect to the remote host and do the operations. but now the client does not want to use SSH to connect. He wants to have an agent running which will listen to all the commands we send from our hosts, and perform the required operations. Is there any way this can be achieved.



An SSH server running on the remote server is an agent so I suspect that what the client wants is to restrict your access much more than SSH does. With your proposed solution you will need to have a Servlet container running on the remote computer and then you will need to be able to upload war files too it presumably using some secure agent such as SSH ! Ooops - SSH is not permitted so what to use to upload the war files?

Also, if you aim to get anything approaching the security of SSH you will need to use HTTPS with client and server side authentication.

 
Ashwin Raghavan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Richard Tookey wrote:
An SSH server running on the remote server is an agent so I suspect that what the client wants is to restrict your access much more than SSH does.



Kind of yes and no. Thing is from his perspective. it becomes a tedious task to install ssh server on all his machines and then copy the keys on them. so wants to go for a better solution.

With your proposed solution you will need to have a Servlet container running on the remote computer and then you will need to be able to upload war files too it presumably using some secure agent such as SSH ! Ooops - SSH is not permitted so what to use to upload the war files?


Not exactly. yes. we need to have a serlet container running. i was thinking more on the lines of like, i will create all the serlets. package them into war. Now. i want to have an executable file. which i will give to the client. and all they need to do is to run the executable (batch or anything) and the war will get deployed onto their server... sounds crazy... but is it possible to do it this way.


or another way is to make this as a service. all cient needs to do is execute the batch file. once executed, a new service will be running on the remote machine which will have servlets listening to my requests.



Also, if you aim to get anything approaching the security of SSH you will need to use HTTPS with client and server side authentication.



Well thats true. but all the servers are inside a secured domain. meaning we all belong to the same secured domain which cannot be accessed from outside.
 
Richard Tookey
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have difficulty seeing that installing your application on a load of machines is going to be less tedious than installing an SSH server on each machine. If you are going to create an installation 'script' of some sort to install your application why cannot that installation script instead just install the SSH server and the certificates? This way you would only have to write the installation script and your maintenance requirement would be minimal.

Am I missing something?
 
Ashwin Raghavan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well what you are saying is true. but here the case is a bit different due to a lot of processes. to install the ssh server the client has to ask some other team to push the software into his node. once done then he has to proceed with the installation. and more often than not. app owners have no idea how the ssh thing works.

In my case. all i have to do is to give the client the my executable and all he has to do is to install. so i was thinking of such an alternative. is it possible to run a java program as a service which will have servlets listening to my requests? ok. it looks like i am trying to substitute SSH Tectia itself. but that actually is my aim. to connect to the server and do the stuff without having ssh in play. all by ysing java.

Is is possible.
 
Richard Tookey
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I will bow out of this. Since both can be installed using an installation disk I am having trouble understanding why installing your software is easier than installing SSH and can't see who is the client and who the server in your setup.
 
Ashwin Raghavan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply


Really appreciate it
 
Police line, do not cross. Well, this tiny ad can go through:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic