Is there any pure and native ruby way to spawn an interactive shell in *one
line*
Since process spawning is an inherently OS-specific operation, there
can't be a pure-ruby implementation of that. If you mean "native" in the
sense that it is included in the core or stdlib, there are #spawn, #system, IO.popen, the backticks, and given the Python code you posted,
the PTY library[1].
Note: I tried all kind of methods like *system*, *exec*, *backticks*, ruby
*pty* nothing works
It appears you have already found PTY. So instead of "does not work",
please be more specific about what does not work. Does it fail to spawn
the process? Does it crash with an exception?
I've tried many solutions with PTY but and "does not work" means the
interactive session never shows up, it never allows the connected machine
to interact with commands line *password* and the session hangs
···
On 20 November 2016 at 16:36, Marvin Gülker <m-guelker@phoenixmail.de> wrote:
Hi,
On Sun, Nov 20, 2016 at 12:50:05AM +0300, KING SABRI wrote:
> Is there any pure and native ruby way to spawn an interactive shell in
*one
> line*
Since process spawning is an inherently OS-specific operation, there
can't be a pure-ruby implementation of that. If you mean "native" in the
sense that it is included in the core or stdlib, there are #spawn, #system, IO.popen, the backticks, and given the Python code you posted,
the PTY library[1].
> Note: I tried all kind of methods like *system*, *exec*, *backticks*,
ruby
> *pty* nothing works
It appears you have already found PTY. So instead of "does not work",
please be more specific about what does not work. Does it fail to spawn
the process? Does it crash with an exception?
Please,
* what you want to achieve (do you want to forward the IO of a remote
passwd command or do you want to present a prompt for the user to
enter their password and then send it over?)
* mention the platform you are trying this on, including Ruby version
* show the code that you executed
* show output, presumably with errors
Otherwise it is practically impossible for the group to come up with
helpful advice.
Btw. how do you set up a "remote shell via netcat"?
Kind regards
robert
···
On Sun, Nov 20, 2016 at 6:19 PM, KING SABRI <king.sabri@gmail.com> wrote:
I've tried many solutions with PTY but and "does not work" means the
interactive session never shows up, it never allows the connected machine to
interact with commands line password and the session hangs