Gambas SSH

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Gambas SSH

Kai-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

Any one know how to get gambas to use ssh?

im stuck im using a socket some thing along the lines of this:

DIM command AS String
   DIM name AS String
   'DIM pass AS String
   DIM ip AS String


   name = txtUserName.Text
   ip = txtServerIp.Text
   command = "/usr/bin/ssh"


' This should make the ssh connection using a client socket protocol ?

  SELECT CASE sshProtocol
    CASE 0 ' This will get every thing ready for a connection to server
      MySock.Host = ip
      MySock.Port = (22)
      'MySock.Id = Val(txtUserName.Text)
      MySock.Connect()
    CASE 1 ' This will make a connection to the server
      MySock.Path = ip
      MySock.Port = Net.Local
      MySock.Id = name
      MySock.Connect(name, "@", ip, command) 'Dont know if this works yet?
  END SELECT

i dont think its working

thanks for any help
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDKdRnw4vrCsJF5ScRAvF/AJ0cu76j78o7/iweiNRXDiQvx9frcQCgwgkj
0nzo5YFLzua7Pk+SaXNMSqc=
=d+NV
-----END PGP SIGNATURE-----



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Gambas SSH

Rob Kudla
On Thu September 15 2005 16:07, Kai wrote:
> Any one know how to get gambas to use ssh?

SSH won't run without a TTY, so you need to write a wrapper program (I
used perl) to emulate a TTY for it.  I don't have the code with me
today, but I'll try to remember to post it.

Once you do that, it's just SHELL "sshwrapper -u user host" FOR READ
WRITE and treat it like any other program.

I remember someone saying they were working on TTY emulation for
gambas2, but I don't know if it went anywhere.

Rob



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Gambas SSH

Kai-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob Kudla wrote:

> On Thu September 15 2005 16:07, Kai wrote:
>
>> Any one know how to get gambas to use ssh?
>
>
> SSH won't run without a TTY, so you need to write a wrapper program
> (I used perl) to emulate a TTY for it. I don't have the code with
> me today, but I'll try to remember to post it.
>
> Once you do that, it's just SHELL "sshwrapper -u user host" FOR
> READ WRITE and treat it like any other program.
>
> I remember someone saying they were working on TTY emulation for
> gambas2, but I don't know if it went anywhere.
>
> Rob
>
>
>
> ------------------------------------------------------- SF.Net
> email is sponsored by: Tame your development challenges with
> Apache's Geronimo App Server. Download it for free - -and be
> entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click
> here to play: http://sourceforge.net/geronimo.php
> _______________________________________________ Gambas-user mailing
> list [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
Hi

Thanks for the reply

Looks like I'll be relaiy on that post for the TTY wrapper as gambas
is the first language i have used, so any help info is greatly
apprechiated.

Thanks
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDKhI3w4vrCsJF5ScRAvRZAJ4/+XGqYjD4TPXmxmIygKeNebt11ACgxD7I
4Xkvwg/LJkYftvfgxgLUMQs=
=yXKg
-----END PGP SIGNATURE-----



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Gambas SSH

Benoît Minisini
In reply to this post by Rob Kudla
On Thursday 15 September 2005 22:48, Rob Kudla wrote:

> On Thu September 15 2005 16:07, Kai wrote:
> > Any one know how to get gambas to use ssh?
>
> SSH won't run without a TTY, so you need to write a wrapper program (I
> used perl) to emulate a TTY for it.  I don't have the code with me
> today, but I'll try to remember to post it.
>
> Once you do that, it's just SHELL "sshwrapper -u user host" FOR READ
> WRITE and treat it like any other program.
>
> I remember someone saying they were working on TTY emulation for
> gambas2, but I don't know if it went anywhere.
>
> Rob
>

In the development version, by using SHELL ... FOR iNPUT OUTPUT, you run your
command inside a pseudo-terminal!

--
Benoit Minisini
mailto:[hidden email]


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Gambas SSH

Laurent Carlier
Benoit Minisini a écrit :
>
>
> In the development version, by using SHELL ... FOR iNPUT OUTPUT, you run your
> command inside a pseudo-terminal!
>

Damned ! i've missed this nice (undocumented ?) feature

Thanks you !

--

Laurent Carlier
jabber : [hidden email]



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Re: Gambas SSH

danielcampos
In reply to this post by Kai-3

>Anyway, you can't copy it freely to write a proprietary book.

I agree with that!

I do not allow to use any part of  the gb.net, gb.compress and gb.xml documentation written by me in a propietary book!

So I hope the book will be able to change that license, or remove these parts...

Regards,

D. Campos




-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 € TTC/min)
Minitel: 3615 NETCOURRIER (0,16 € TTC/min)



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Gambas SSH

Kai-3
In reply to this post by Laurent Carlier
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

after much testing i came up with this:

  DIM command AS String
  DIM name AS String
  DIM pass AS String
  DIM ipinfo AS String
 
  ''  make ssh connection to remote server

  name = txtUserName.Text
  ipinfo = txtServerIp.Text
 
  command = "/usr/bin/ssh " & name & "@" & ipinfo

  SHELL command

  pass = txtPassword.Text

  IF command = TRUE THEN
  pass
  END IF

when im stepping through the code every thing seems to goto plan then at

pass = txtPassword.Text

i get a console showing with the following and im not too sure what to
make of it

Pseudo-terminal will not be allocated because stdin is not a terminal

Any one know what that means ?

Thanks

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDLTeXw4vrCsJF5ScRAqj1AKDjGCi1PbgtEpjcTk/MuNgJXQUIKwCePc5q
paPbD/7su+cxOJ7/yp2OrBg=
=vohs
-----END PGP SIGNATURE-----



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user