|
|
|
|
||||||
| comp.security.ssh SSH secure remote login and tunneling tools. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
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/ |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
I'm very sorry for that amount of spam - browser problems.
|
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
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/ |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
> 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. |
|
![]() |
| Outils de la discussion | |
|
|