Page 1 of 1

ssh from gambas on linux

Posted: Saturday 7th December 2019 7:01pm
by seany
Hi
Its me again

I wish to ssh to a target server (say, a.b.c.d) from gambas.

I know i could use some "exec" trics, but does gambas provide a way to use ssh or curl or anything to quickly check the last few line on a file in an web server? thank you

Re: ssh from gambas on linux

Posted: Sunday 8th December 2019 6:43am
by stevedee
seany wrote: Saturday 7th December 2019 7:01pm ...I wish to ssh to a target server (say, a.b.c.d) from gambas...
As far as I know there are no Gambas wrappers for ssh.

I don't really know what you want to do, but if the web server belongs to you then you could use Sockets (gb.net) for communication between a remote computer and your server.

Re: ssh from gambas on linux

Posted: Sunday 8th December 2019 11:44am
by cogier
If you are looking to download something from the net then there is the component gb.net.curl.

If you would like an example then have a look at 'Your_Location' on the Farm or available here. It gets information about your location from your IP address.

Re: ssh from gambas on linux

Posted: Saturday 21st December 2019 2:09am
by seany
I want to log in, and execute a script.

Re: ssh from gambas on linux

Posted: Saturday 21st December 2019 4:29pm
by stevedee

Re: ssh from gambas on linux

Posted: Wednesday 8th January 2020 12:58pm
by gbWilly
Hi seany,

Login on a server and install Gambas updates is something is do from within a Gambas GUI application on a client.

How did I do this:
1. I wrote a Gambas application that is a socked server command line application (see gb.net) that runs as a root application on a Debian server.

2. I wrote a Gambas application that is a socked client with a gui interface that runs on a Linux Mint client.
This client sends commands to the socked server that are executed by the socket server with root privileges.
I use it for stuff like:
- Install new updates (I push them using rsync between client and server from within the GUI application)
- View logfiles on the server
- Send commands directly to the server (like pstree to see a tree with active processes)

I can't post you the Gambas applications or code as they are at work and copyrighted.
But if you have questions I will gladly answer then.

First study gb.net and sockets and have a good understanding of that
Secondly understand you server side of things, like how to get applications running as a deamon with root privileges.