Interactive Shell with the underlying system

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 … :slight_smile:

Daniel E. 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?

Aldric G. wrote:

Daniel E. 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

Daniel E. 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. :slight_smile:

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 … :slight_smile:

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Daniel E. 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?

Aldric G. wrote:

Daniel E. 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… :slight_smile: 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… :slight_smile:

Greetings Kaji

Marnen Laibow-Koser wrote:

Daniel E. 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. :slight_smile:

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 … :slight_smile:

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

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… :slight_smile:

Greetings Kaji

Daniel E. wrote:

Marnen Laibow-Koser wrote:

Daniel E. 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. :slight_smile:

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… :slight_smile:

Greetings Kaji

On Tue, 2009-11-10 at 14:42 +0100, Marnen Laibow-Koser wrote:

Daniel E. 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.

Daniel E. 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… :slight_smile:

Dude. Not with Rails. Maybe Merb or Sinatra?

Greetings Kaji

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Craig W. wrote:

On Tue, 2009-11-10 at 14:42 +0100, Marnen Laibow-Koser wrote:

Daniel E. 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

Daniel E. 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
[email protected]

Greetings Kaji

Marnen Laibow-Koser wrote:

Daniel E. 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
[email protected]

Greetings Kaji

Daniel E. 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.

Daniel E. wrote:

Marnen Laibow-Koser wrote:

Daniel E. 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
[email protected]

Aldric G. wrote:

Daniel E. 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

Daniel E. 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.

Greetings Kaji

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Craig W. wrote:
[…]

actually, webmin’s ssh login shell is a java applet that is GPL

Good 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
[email protected]

Marnen Laibow-Koser wrote:

Daniel E. 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 G. 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
[email protected]

Daniel E. 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 G. 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.