Hey Guys out there, i have the idea to make an shell via website in rails, like the tryruby thing. But not to only execute ruby commands. I want it to be like the system shell an execute commands like in the shell of the system itself. I have read that i can execute commands, but to get the output completly seems not quite easy. Are there any ideas out there? Greetings Kaji P.S. I fully administrate these servers so i don´t want to hack or anything, i just want to make some admanistration utility in ruby on rails .. :) -- Posted via http://www.ruby-forum.com/.
Daniel Ernst wrote:> Hey Guys out there, > > i have the idea to make an shell via website in rails, like the tryruby > thing. But not to only execute ruby commands. I want it to be like the > system shell an execute commands like in the shell of the system itself. > I have read that i can execute commands, but to get the output completly > seems not quite easy. >You mean you want to use SSH to connect to servers? -- Posted via http://www.ruby-forum.com/.
Aldric Giacomoni wrote:> Daniel Ernst wrote: >> Hey Guys out there, >> >> i have the idea to make an shell via website in rails, like the tryruby >> thing. But not to only execute ruby commands. I want it to be like the >> system shell an execute commands like in the shell of the system itself. >> I have read that i can execute commands, but to get the output completly >> seems not quite easy. >> > > You mean you want to use SSH to connect to servers?No. I want to install ruby and rails on these servers. It would be something like console redirect, but that donw´t work. So i want it make in software to get something like an shell. The Core is to execute all commands avaible in the shell an get all outpout from these things. So an generelly aproach where fantastic, but others ideas to aproach this would be great! Greetings Kaji -- Posted via http://www.ruby-forum.com/.
Daniel Ernst wrote:>> >> You mean you want to use SSH to connect to servers? > > No. I want to install ruby and rails on these servers. It would be > something like console redirect, but that donw´t work. So i want it make > in software to get something like an shell. The Core is to execute all > commands avaible in the shell an get all outpout from these things. So > an generelly aproach where fantastic, but others ideas to aproach this > would be great! > > Greetings KajiYou want to build a server administration tool using Ruby on Rails - so the tool would have a web-based GUI? Is that it? -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 13:05 UTC
Re: Interactive Shell with the underlying system
Daniel Ernst wrote:> Hey Guys out there, > > i have the idea to make an shell via website in rails, like the tryruby > thing. But not to only execute ruby commands. I want it to be like the > system shell an execute commands like in the shell of the system itself. > I have read that i can execute commands, but to get the output completly > seems not quite easy. > > Are there any ideas out there? >Use Webmin and don''t reinvent the wheel. :)> > Greetings > > Kaji > > P.S. I fully administrate these servers so i don´t want to hack or > anything, i just want to make some admanistration utility in ruby on > rails .. :)Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Aldric Giacomoni wrote:> Daniel Ernst wrote: >>> >>> You mean you want to use SSH to connect to servers? >> >> No. I want to install ruby and rails on these servers. It would be >> something like console redirect, but that donw´t work. So i want it make >> in software to get something like an shell. The Core is to execute all >> commands avaible in the shell an get all outpout from these things. So >> an generelly aproach where fantastic, but others ideas to aproach this >> would be great! >> >> Greetings Kaji > > You want to build a server administration tool using Ruby on Rails - so > the tool would have a web-based GUI? > Is that it?Jeah that is it. I want to use a web-based GUI and make Administrations Task, and the best thing would be, when i had something like an interactiv shell with the underlying system.. :) Ah and naturally, i want make it myself..^^ But i dont have the right start right now, so may u guys have a starting point for the interaction.. :) Greetings Kaji -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Daniel Ernst wrote: >> Hey Guys out there, >> >> i have the idea to make an shell via website in rails, like the tryruby >> thing. But not to only execute ruby commands. I want it to be like the >> system shell an execute commands like in the shell of the system itself. >> I have read that i can execute commands, but to get the output completly >> seems not quite easy. >> >> Are there any ideas out there? >> > > Use Webmin and don''t reinvent the wheel. :) > >> >> Greetings >> >> Kaji >> >> P.S. I fully administrate these servers so i don´t want to hack or >> anything, i just want to make some admanistration utility in ruby on >> rails .. :) > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgJeah thought of Webmin and i know it, but i don´t know that there would be an interactiv shell within webmin? So that thing and some other things bring me up to my own one.. :) Greetings Kaji -- Posted via http://www.ruby-forum.com/.
Daniel Ernst wrote:> Marnen Laibow-Koser wrote: >> Daniel Ernst wrote: >>> Hey Guys out there, >>> >>> i have the idea to make an shell via website in rails, like the tryruby >>> thing. But not to only execute ruby commands. I want it to be like the >>> system shell an execute commands like in the shell of the system itself. >>> >> >> Use Webmin and don''t reinvent the wheel. :) >>> > Jeah thought of Webmin and i know it, but i don´t know that there would > be an interactiv shell within webmin? So that thing and some other > things bring me up to my own one.. :) > > Greetings Kajihttp://www.webmin.com/cgi-bin/search_third.cgi?search=ssh -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 13:42 UTC
Re: Interactive Shell with the underlying system
Daniel Ernst wrote: [...]> Jeah thought of Webmin and i know it, but i don´t know that there would > be an interactiv shell within webmin?Well, you should look for it before concluding that there isn''t one! In fact, Webmin has just such a thing, although it''s not very well implemented. So does Slicehost, although I don''t know if their solution is open-source.> So that thing and some other > things bring me up to my own one.. :) >Dude. Not with Rails. Maybe Merb or Sinatra?> Greetings KajiBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
On Tue, 2009-11-10 at 14:42 +0100, Marnen Laibow-Koser wrote:> Daniel Ernst wrote: > [...] > > Jeah thought of Webmin and i know it, but i don´t know that there would > > be an interactiv shell within webmin? > > Well, you should look for it before concluding that there isn''t one! In > fact, Webmin has just such a thing, although it''s not very well > implemented.---- actually, webmin''s ssh login shell is a java applet that is GPL and could probably be wired in using something like rjb or jruby. Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
Marnen Laibow-Koser
2009-Nov-10 14:22 UTC
Re: Interactive Shell with the underlying system
Craig White wrote: [...]> actually, webmin''s ssh login shell is a java applet that is GPLGood point.> and > could probably be wired in using something like rjb or jruby.No need. Just call it from a static HTML page. No server-side programming necessary.> > Craig > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean.Please stop including this pointless footer in your messages. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Craig White wrote:> On Tue, 2009-11-10 at 14:42 +0100, Marnen Laibow-Koser wrote: >> Daniel Ernst wrote: >> [...] >> > Jeah thought of Webmin and i know it, but i don´t know that there would >> > be an interactiv shell within webmin? >> >> Well, you should look for it before concluding that there isn''t one! In >> fact, Webmin has just such a thing, although it''s not very well >> implemented. > ---- > actually, webmin''s ssh login shell is a java applet that is GPL and > could probably be wired in using something like rjb or jruby. > > Craig > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean.Hello guys, thanks for u reply. Ok there is something with ssh, sorry that i haven´t searched for it. But i may have something without ssh or else, something that would be more direct. In the case of taking ssh i could take an Webservice too. But i think an direct aproach would be much nicer. But there seems nothing really nice to be out there, isn´t it? Marnen Laibow-Koser : Would be the improvment in taking Merb or Senatra? Would there be an aproach? Greetings Kaji -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 14:33 UTC
Re: Interactive Shell with the underlying system
Daniel Ernst wrote: [...]> Hello guys, > > thanks for u reply. Ok there is something with ssh, sorry that i haven´t > searched for it. But i may have something without ssh or else, something > that would be more direct. In the case of taking ssh i could take an > Webservice too. But i think an direct aproach would be much nicer.SSH is direct. What else do you need?> But > there seems nothing really nice to be out there, isn´t it?What are you looking for?> > Marnen Laibow-Koser : Would be the improvment in taking Merb or Senatra?They''re lighter-weight frameworks. You probably don''t need much of Rails'' feature set, so there''s no point in using Rails.> Would there be an aproach?Huh? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org> > > Greetings Kaji-- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Daniel Ernst wrote: > [...] >> Hello guys, >> >> thanks for u reply. Ok there is something with ssh, sorry that i haven´t >> searched for it. But i may have something without ssh or else, something >> that would be more direct. In the case of taking ssh i could take an >> Webservice too. But i think an direct aproach would be much nicer. > > SSH is direct. What else do you need?I mean, for SSH i need an SSH deamon an make an extra "connection". When i use ruby with whatever webserver / engine i use ruby already, so when i can direct commanding and get output, it would be an directer aproach for me, isn it?> >> But >> there seems nothing really nice to be out there, isn´t it? > > What are you looking for?see above> >> >> Marnen Laibow-Koser : Would be the improvment in taking Merb or Senatra? > > They''re lighter-weight frameworks. You probably don''t need much of > Rails'' feature set, so there''s no point in using Rails. > >> Would there be an aproach? > > Huh? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org >> >>Greetings Kaji -- Posted via http://www.ruby-forum.com/.
Daniel Ernst wrote:>> >> SSH is direct. What else do you need? > > I mean, for SSH i need an SSH deamon an make an extra "connection". When > i use ruby with whatever webserver / engine i use ruby already, so when > i can direct commanding and get output, it would be an directer aproach > for me, isn it? >So you actually want a web interface to talk with the server on which the rails application is running, and not a web interface to administer many servers; is that correct? I suppose you could get a textbox and wrap the input with a ''system'' call, and then catch the output and display it back at you, but that''s a bit like playing with a live grenade without a pin. This sounds like an interesting coding exercise.. But not like a practical solution to a problem which, I feel, has been misunderstood. -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 14:49 UTC
Re: Interactive Shell with the underlying system
Daniel Ernst wrote:> Marnen Laibow-Koser wrote: >> Daniel Ernst wrote: >> [...] >>> Hello guys, >>> >>> thanks for u reply. Ok there is something with ssh, sorry that i haven´t >>> searched for it. But i may have something without ssh or else, something >>> that would be more direct. In the case of taking ssh i could take an >>> Webservice too. But i think an direct aproach would be much nicer. >> >> SSH is direct. What else do you need? > > I mean, for SSH i need an SSH deamon an make an extra "connection". When > i use ruby with whatever webserver / engine i use ruby already, so when > i can direct commanding and get output, it would be an directer aproach > for me, isn it?No. If that were possible, it would be a huge security hole on your server -- you really don''t want the user to be able to hijack an HTTP session and run arbitrary shell commands. SSH is the proper solution. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Aldric Giacomoni wrote:> Daniel Ernst wrote: > >>> >>> SSH is direct. What else do you need? >> >> I mean, for SSH i need an SSH deamon an make an extra "connection". When >> i use ruby with whatever webserver / engine i use ruby already, so when >> i can direct commanding and get output, it would be an directer aproach >> for me, isn it? >> > > So you actually want a web interface to talk with the server on which > the rails application is running, and not a web interface to administer > many servers; is that correct? > I suppose you could get a textbox and wrap the input with a ''system'' > call, and then catch the output and display it back at you, but that''s a > bit like playing with a live grenade without a pin.You got the Point. Is it possibly to catch the output? I mean, when there is an task that needs longer, can i wait as long as it takes and get the complet output? When, that would be the best point in starting it.> This sounds like an interesting coding exercise.. But not like a > practical solution to a problem which, I feel, has been misunderstood.For me, i think it is the right point. I am using FreeBSD where i primary compile everything etc. Jeah i could do everything with ssh ( What i do know ) But i would like to make somethings automatically so, i hit a button, for hmm "compiling and installing samba" so in the webbrowser would be the "shell" i see and ruby would make the commands. When there is something wrong i would see the right output and can act. So it would be a play with ruby automatication and interactivity. Marnen Laibow-Koser: Jeah it is maked for it, but i think http can be quite save too and things to do without vpn is even, not the right thing. Greetings Kaji -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 15:11 UTC
Re: Interactive Shell with the underlying system
Daniel Ernst wrote: [...]> Marnen Laibow-Koser: Jeah it is maked for it, but i think http can be > quite save tooNo. For one thing, the Web app will be running as the wrong user.> and things to do without vpn is even, not the right > thing.VPN doesn''t come into it. There is *no way* to make this secure without something like SSH. If you try to go through HTTP, you run the real risk of COMPLETELY WRECKING YOUR SYSTEM. If you don''t know why this is so, then you do not understand the security issues involved well enough to have any business writing this. SSH is the proper solution. Anything else is INCREDIBLY UNSAFE.> > > Greetings KajiBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Daniel Ernst wrote: > [...] >> Marnen Laibow-Koser: Jeah it is maked for it, but i think http can be >> quite save too > > No. For one thing, the Web app will be running as the wrong user. > >> and things to do without vpn is even, not the right >> thing. > > VPN doesn''t come into it. There is *no way* to make this secure without > something like SSH. If you try to go through HTTP, you run the real > risk of COMPLETELY WRECKING YOUR SYSTEM. If you don''t know why this is > so, then you do not understand the security issues involved well enough > to have any business writing this. > > SSH is the proper solution. Anything else is INCREDIBLY UNSAFE.Jeah i think we are quite a litte bit off topic here. But i mean, whats wrong with HTTPS and above of that Kerberos authentification? SSH isn better encryptet as HTTPS. Back to Topic Aldric Giacomoni aproach sounds really interessting, so does it work? Or where do i have to start? Oh, don´t sorry i don´t bag u for a complet solution, i am just searching for the right hint. Greetings Kaji> > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org-- Posted via http://www.ruby-forum.com/.
Daniel Ernst wrote:>> >> VPN doesn''t come into it. There is *no way* to make this secure without >> something like SSH. If you try to go through HTTP, you run the real >> risk of COMPLETELY WRECKING YOUR SYSTEM. If you don''t know why this is >> so, then you do not understand the security issues involved well enough >> to have any business writing this. >> >> SSH is the proper solution. Anything else is INCREDIBLY UNSAFE. > > Jeah i think we are quite a litte bit off topic here. But i mean, whats > wrong with HTTPS and above of that Kerberos authentification? SSH isn > better encryptet as HTTPS. > > Back to Topic Aldric Giacomoni aproach sounds really interessting, so > does it work? Or where do i have to start?Marnen and I are talking about the same thing, and I agree with Marnen on everything he has said so far. But, if you insist on hanging yourself, here''s some rope. http://ruby-doc.org/core/classes/Shell.html http://ruby-doc.org/core/classes/Shell/CommandProcessor.html#M002436 Please allow me to repeat what we have so far: You would like a webpage which allows the user to do things like compile packages and install them? This means anyone who gets to the page can do that - assuming the rails application is running as a user who can compile and install packages... Because I do not know if there is a way to "change user" in Ruby. So it sounds like you would need to run the rails application as root, which is also quite insecure. I do urge you to reconsider. -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser
2009-Nov-10 15:43 UTC
Re: Interactive Shell with the underlying system
Daniel Ernst wrote: [...]> Jeah i think we are quite a litte bit off topic here. But i mean, whats > wrong with HTTPS and above of that Kerberos authentification? SSH isn > better encryptet as HTTPS.The issue is not one of encryption, but of authentication. HTTP simply doesn''t provide the user model that you need.> > Back to Topic Aldric Giacomoni aproach sounds really interessting, so > does it work? Or where do i have to start?Don''t use it. Use SSH.> > Oh, don´t sorry i don´t bag u for a complet solution, i am just > searching for the right hint. >SSH is a complete solution. You''ve been told this several times. It is the right hint. Your idea is DANGEROUS. Do not implement it unless you are SURE that you can deal with the security issues. Once more: use SSH. Completely forget about your HTTP idea v> Greetings Kaji >> >> Best, >> -- >> Marnen Laibow-Koser >> http://www.marnen.org >> marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org-- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Daniel Ernst wrote: > [...] >> Jeah i think we are quite a litte bit off topic here. But i mean, whats >> wrong with HTTPS and above of that Kerberos authentification? SSH isn >> better encryptet as HTTPS. > > The issue is not one of encryption, but of authentication. HTTP simply > doesn''t provide the user model that you need. > >> >> Back to Topic Aldric Giacomoni aproach sounds really interessting, so >> does it work? Or where do i have to start? > > Don''t use it. Use SSH. > >> >> Oh, don´t sorry i don´t bag u for a complet solution, i am just >> searching for the right hint. >> > > SSH is a complete solution. You''ve been told this several times. It is > the right hint. Your idea is DANGEROUS. Do not implement it unless you > are SURE that you can deal with the security issues. > > Once more: use SSH. Completely forget about your HTTP idea v > >> Greetings Kaji >>> >>> Best, >>> -- >>> Marnen Laibow-Koser >>> http://www.marnen.org >>> marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgHey guys again, so hmm, yes i thought of an kerberos pre authentification, but the most neckle would be to run ruby under different users etc, that sounds like a lot of pain. So maybe i make something with SSH, with a really nice redirect with ajax to the Webbrowser, hmm ok guys ! Thanks a lot, i will look forward to it and post when i have something nice. Greetings Kaji -- Posted via http://www.ruby-forum.com/.
This is certainly an interesting idea, though I agree with others that this could very quickly turn ugly. That said, I think the code you''re looking for is %x[some command]. Jay Fields has a good bit on it here: http://blog.jayfields.com/2006/06/ruby-kernel-system-exec-and-x.html In short, %x[command] will run command on the shell and return the output. e.g., result = %x[uptime] result #=> "13:16 up 4 days, 1:30, 2 users, load averages: 0.39 0.29 0.23\n" Best of luck, Jeff Tucker On Nov 10, 10:02 am, Daniel Ernst <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Aldric Giacomoni wrote: > > Daniel Ernst wrote: > > >>> SSH is direct. What else do you need? > > >> I mean, for SSH i need an SSH deamon an make an extra "connection". When > >> i use ruby with whatever webserver / engine i use ruby already, so when > >> i can direct commanding and get output, it would be an directer aproach > >> for me, isn it? > > > So you actually want a web interface to talk with the server on which > > the rails application is running, and not a web interface to administer > > many servers; is that correct? > > I suppose you could get a textbox and wrap the input with a ''system'' > > call, and then catch the output and display it back at you, but that''s a > > bit like playing with a live grenade without a pin. > > You got the Point. Is it possibly to catch the output? I mean, when > there is an task that needs longer, can i wait as long as it takes and > get the complet output? When, that would be the best point in starting > it. > > > This sounds like an interesting coding exercise.. But not like a > > practical solution to a problem which, I feel, has been misunderstood. > > For me, i think it is the right point. I am using FreeBSD where i > primary compile everything etc. Jeah i could do everything with ssh ( > What i do know ) But i would like to make somethings automatically so, i > hit a button, for hmm "compiling and installing samba" so in the > webbrowser would be the "shell" i see and ruby would make the commands. > When there is something wrong i would see the right output and can act. > So it would be a play with ruby automatication and interactivity. > > Marnen Laibow-Koser: Jeah it is maked for it, but i think http can be > quite save too and things to do without vpn is even, not the right > thing. > > Greetings Kaji > -- > Posted viahttp://www.ruby-forum.com/.