PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.security.ssh > SSH application in Java
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.security.ssh SSH secure remote login and tunneling tools.

SSH application in Java

Réponse
 
LinkBack Outils de la discussion
Vieux 21/08/2007, 14h27   #1
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut SSH application in Java

Hi,

I need to write small application in Java which will connect to
computer with Linux OS and execute "reboot" command there (the
direction is to automate this process and do it on lot of pc's "at
once" by one *kick*). All using SSH. I tried sshtools (get tons of
errors, especially becouse no logfactory), now I'm focused on jsch but
have problems too. Can you (group) please tell me if I'm going right
direction, or perhaps my task could be done way easier? I'll be
thankfull for any ideas and tips.

Thanks in advice,
Mateusz Zajakala

  Réponse avec citation
Vieux 21/08/2007, 22h06   #2
all mail refused
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 2007-08-21, mateusz.zajakala@gmail.com <mateusz.zajakala@gmail.com> wrote:

> I need to write small application in Java which will connect to
> computer with Linux OS and execute "reboot" command there (the
> direction is to automate this process and do it on lot of pc's "at
> once" by one *kick*). All using SSH. I tried sshtools (get tons of
> errors, especially becouse no logfactory), now I'm focused on jsch but
> have problems too. Can you (group) please tell me if I'm going right
> direction, or perhaps my task could be done way easier? I'll be
> thankfull for any ideas and tips.


That shows how far Linux has to go to catch up with Solaris which
you could reboot with a ping packet 10 years ago.

It might make a difference what platform you are calling from what
tools you can use there - I don't think you said enough about that.
Does it really have to be Java?

--
Elvis Notargiacomo master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/
  Réponse avec citation
Vieux 22/08/2007, 08h25   #3
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 21 Sie, 23:06, all mail refused <elvis-85...@notatla.org.uk> wrote:
> That shows how far Linux has to go to catch up with Solaris which
> you could reboot with a ping packet 10 years ago.


Good point :-)

> It might make a difference what platform you are calling from what
> tools you can use there - I don't think you said enough about that.


I'm going to use it on Windows Server and, like I said, connect to
computer with Linux. That's why I think Java could be good idea,
becouse of portability. Jsch worked for me yesterday just after I
wrote this post (force majeure?), looks like it probably has what I
need, I just have to explore it more now.

> Does it really have to be Java?


Not really. I have free choice in here, but I prefer Java... If there
is better way to do it I'm open for any ideas. Perhaps C# would be
good (or even better) idea.

Thanks for answer,
Mateusz Zajakala

  Réponse avec citation
Vieux 22/08/2007, 08h25   #4
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 21 Sie, 23:06, all mail refused <elvis-85...@notatla.org.uk> wrote:
> That shows how far Linux has to go to catch up with Solaris which
> you could reboot with a ping packet 10 years ago.


Good point :-)

> It might make a difference what platform you are calling from what
> tools you can use there - I don't think you said enough about that.


I'm going to use it on Windows Server and, like I said, connect to
computer with Linux. That's why I think Java could be good idea,
becouse of portability. Jsch worked for me yesterday just after I
wrote this post (force majeure?), looks like it probably has what I
need, I just have to explore it more now.

> Does it really have to be Java?


Not really. I have free choice in here, but I prefer Java... If there
is better way to do it I'm open for any ideas. Perhaps C# would be
good (or even better) idea.

Thanks for answer,
Mateusz Zajakala

  Réponse avec citation
Vieux 22/08/2007, 08h25   #5
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 21 Sie, 23:06, all mail refused <elvis-85...@notatla.org.uk> wrote:
> That shows how far Linux has to go to catch up with Solaris which
> you could reboot with a ping packet 10 years ago.


Good point :-)

> It might make a difference what platform you are calling from what
> tools you can use there - I don't think you said enough about that.


I'm going to use it on Windows Server and, like I said, connect to
computer with Linux. That's why I think Java could be good idea,
becouse of portability. Jsch worked for me yesterday just after I
wrote this post (force majeure?), looks like it probably has what I
need, I just have to explore it more now.

> Does it really have to be Java?


Not really. I have free choice in here, but I prefer Java... If there
is better way to do it I'm open for any ideas. Perhaps C# would be
good (or even better) idea.

Thanks for answer,
Mateusz Zajakala

  Réponse avec citation
Vieux 22/08/2007, 08h40   #6
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 21 Sie, 23:06, all mail refused <elvis-85...@notatla.org.uk> wrote:
> That shows how far Linux has to go to catch up with Solaris which
> you could reboot with a ping packet 10 years ago.


Good point :-)

> It might make a difference what platform you are calling from what
> tools you can use there - I don't think you said enough about that.


I'm going to use it on Windows Server and, like I said, connect to
computer with Linux. That's why I think Java could be good idea,
becouse of portability. Jsch worked for me yesterday just after I
wrote this post (force majeure?), looks like it probably has what I
need, I just have to explore it more now.

> Does it really have to be Java?


Not really. I have free choice in here, but I prefer Java... If there
is better way to do it I'm open for any ideas. Perhaps C# would be
good (or even better) idea.

Thanks for answer,
Mateusz Zajakala

  Réponse avec citation
Vieux 22/08/2007, 08h44   #7
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

I'm very sorry for that amount of spam - browser problems.

  Réponse avec citation
Vieux 22/08/2007, 09h24   #8
Steven Mocking
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

mateusz.zajakala@gmail.com wrote:
> I need to write small application in Java which will connect to
> computer with Linux OS and execute "reboot" command there (the
> direction is to automate this process and do it on lot of pc's "at
> once" by one *kick*). All using SSH. I tried sshtools (get tons of
> errors, especially becouse no logfactory), now I'm focused on jsch but
> have problems too. Can you (group) please tell me if I'm going right
> direction, or perhaps my task could be done way easier? I'll be
> thankfull for any ideas and tips.


If it doesn't have to be java, why not simply setup a public/private key
pair, add 'username ALL = NOPASSWD: /sbin/reboot' to /etc/sudoers, so
you can use

ssh username@host sudo reboot

from the windows machine?
  Réponse avec citation
Vieux 22/08/2007, 10h03   #9
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 22 Sie, 10:24, Steven Mocking
<u...@quicknet.youmightwanttogetridofthis.nl> wrote:
> If it doesn't have to be java, why not simply setup a public/private key
> pair, add 'username ALL = NOPASSWD: /sbin/reboot' to /etc/sudoers, so
> you can use
>
> ssh username@host sudo reboot
>
> from the windows machine?


Like I wrote earlier (perhaps not too clearly - my bad), the
destination is to execute reboot command on more than one machine at
one time. I can do this using for ex. putty (log in -> reboot ->
logout -> log in to next comp ...), but I want to make my life easier
and make app which will do the same on many machine. So I don't have
to log to every single comp and execute reboot.

  Réponse avec citation
Vieux 22/08/2007, 10h13   #10
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

And another thing I didn't mention about ;-) After completing that
"reboot task" I will have to do is file transfer (afaik now - through
sftp). I will have to overrite one specific, single file on host
computer. But that is next step of my work, now I have to focus on
reboot. I just wanted to mention about that, so we can think about
solution that will work for both issues, not only first.

  Réponse avec citation
Vieux 22/08/2007, 15h17   #11
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

Looks like I've done it. With one *klick* my application reboots few
computers one by one. I've decided to use C# (as it's going to be used
under Windows Server) and Jsch api for it - works great.

Now it's time for second part - file transfer. I think (hope) it'll be
easy now.

Thanks for support and ideas,
Mateusz Zajakala

  Réponse avec citation
Vieux 22/08/2007, 18h54   #12
all mail refused
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

On 2007-08-22, mateusz.zajakala@gmail.com <mateusz.zajakala@gmail.com> wrote:

> and make app which will do the same on many machine. So I don't have
> to log to every single comp and execute reboot.


Sounds as if you are reinventing fanout.

--
Elvis Notargiacomo master AT barefaced DOT cheek
http://www.notatla.org.uk/goen/
  Réponse avec citation
Vieux 24/08/2007, 16h33   #13
Steven Mocking
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

all mail refused wrote:
> On 2007-08-22, mateusz.zajakala@gmail.com <mateusz.zajakala@gmail.com> wrote:
>
>> and make app which will do the same on many machine. So I don't have
>> to log to every single comp and execute reboot.

>
> Sounds as if you are reinventing fanout.
>


Or a trivial cmd batch script. I bet the root password is embedded into
his C# code as well.

Matheusz, in the future you might want to search around for a bit before
coding your own applications for such common problems. Unless you enjoy
the programming exercise, of course.
  Réponse avec citation
Vieux 27/08/2007, 07h46   #14
mateusz.zajakala@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: SSH application in Java

> Matheusz, in the future you might want to search around for a bit before
> coding your own applications for such common problems. Unless you enjoy
> the programming exercise, of course.


That's why I asked in here. Anyway I found it simple to program it
myselvse, that's why I decided to do this (for exercise too). But
you're right - simple problems need simple solutions.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 17h51.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,21414 seconds with 22 queries