ssh from gambas on linux

For questions about Gambas web tools.
Post Reply
seany
Posts: 32
Joined: Friday 6th December 2019 3:09pm

ssh from gambas on linux

Post 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
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: ssh from gambas on linux

Post 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.
User avatar
cogier
Site Admin
Posts: 1117
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: ssh from gambas on linux

Post 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.
seany
Posts: 32
Joined: Friday 6th December 2019 3:09pm

Re: ssh from gambas on linux

Post by seany »

I want to log in, and execute a script.
User avatar
gbWilly
Posts: 68
Joined: Friday 23rd September 2016 11:41am
Location: Netherlands
Contact:

Re: ssh from gambas on linux

Post 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.
gbWilly
- Dutch translation for Gambas3
- Gambas wiki content contributer


... there is always a Catch if things go wrong!
Post Reply