SSH Client
-
- Posts: 59
- Joined: Thu Jan 19, 2017 5:17 pm
SSH Client
I have have a wireless range extender that I would like to configure with the ESP32. I can ssh into the range extender and update configuration files. Is there anyway to ssh into a linux box from the ESP32?
The idea is that I can have the ESP32 look for the default SSID of the range extender. Once it finds it, it can connect and update the configuration files. This way I do not have to manually update the configuration files of the range extender or use the web ui of the range extender.
Thoughts?
The idea is that I can have the ESP32 look for the default SSID of the range extender. Once it finds it, it can connect and update the configuration files. This way I do not have to manually update the configuration files of the range extender or use the web ui of the range extender.
Thoughts?
Re: SSH Client
Not sure what the advantage of using the esp32 for this is over a script on an android phone or something.
-
- Posts: 9772
- Joined: Thu Nov 26, 2015 4:08 am
-
- Posts: 1
- Joined: Thu Mar 09, 2017 8:24 am
Re: SSH Client
Does the extender support TLS over telnet? Thats probably a lot easier to get working quickly.
-
- Posts: 59
- Joined: Thu Jan 19, 2017 5:17 pm
Re: SSH Client
They do support telnet, but I am not sure about TLS over telnet. I'll have to confirm. If so, should I use a library like this one?
https://github.com/seanmiddleditch/libtelnet
How exactly do I get the LibSSH or LibSSH2 library to work on the ESP32? Or any external library for that matter? I use eclipse and code in c.
https://github.com/seanmiddleditch/libtelnet
How exactly do I get the LibSSH or LibSSH2 library to work on the ESP32? Or any external library for that matter? I use eclipse and code in c.
Re: SSH Client
This might help you viewtopic.php?t=815
-
- Posts: 59
- Joined: Thu Jan 19, 2017 5:17 pm
Re: SSH Client
I followed the example you gave, and it worked for the mongoose. When I tried to do the same for libssh, I ran into issues.
I created a directory in my project directory called components, cloned libssh into the components directory, added the file component.mk, and included the library in my project main.c.
When I include the <libssh/libssh.h> library, the compiler says No such file or directory.
Inside the libssh directory I cloned, I found an include directory. I changed my #include <libssh/libssh.h> to #include <include/libssh/libssh.h>. Now the compiler says:
Any ideas? Do I need to build libssh first? If so, how do I build it for the esp32 and include it?
Thanks
I created a directory in my project directory called components, cloned libssh into the components directory, added the file component.mk, and included the library in my project main.c.
Code: Select all
mkdir components
cd components
git clone git://git.libssh.org/projects/libssh.git libssh
cd libssh
nano component.mk //File contains one line: COMPONENT_ADD_INCLUDEDIRS=.
Inside the libssh directory I cloned, I found an include directory. I changed my #include <libssh/libssh.h> to #include <include/libssh/libssh.h>. Now the compiler says:
Code: Select all
fatal error: sys/select.h: No such file or directory
Thanks
-
- Posts: 59
- Joined: Thu Jan 19, 2017 5:17 pm
Re: SSH Client
This post uses libssh2. It works for needs
Re: SSH Client
Here is an Arduino library that implements an SSH client using libssh2:
https://github.com/J-Rios/Arduino-esp32sshclient
It also can be used from ESPIDF Framework too.
https://github.com/J-Rios/Arduino-esp32sshclient
It also can be used from ESPIDF Framework too.
Re: SSH Client
I am looking to have an ESP32(client) establish an SHH session and send commands to another system.
When using the lib above and running any of the examples, my ESP32s keep failing to connect in the lets_handshake function.
Code: Select all
int8_t ESP32SSHCLIENT::lets_handshake(void)
Code: Select all
The authenticity of host '192.168.1.25 (192.168.1.25)' can't be established.
ECDSA key fingerprint is SHA256:sgeYqimuwjN1Jp/bKelxHjbQKPUIGCt0UYjmSCcmwoo.
Are you sure you want to continue connecting (yes/no)?
Is there a way to say yes to the the initial handshake?
Do any of you have a working example on an ESP?
Do any of you have an example using the longer connect command? I am unsure of the syntax for that connect call.
Code: Select all
int8_t connect(const char* host, const uint16_t port, const char* user, uint8_t* pubkey,
size_t pubkeylen, uint8_t* privkey, size_t privkeylen, const char* key_passphrase);
Who is online
Users browsing this forum: Baidu [Spider], Bing [Bot] and 74 guests