I am trying to SSH into a raspberry pi, then i want to navigate to a directory and then execute a command and wait for it complete and then run a second command.
SSH into Raspberry Pi
Navigate to a specific directory
Run a command (run a script)
Wait for completion
Run a command (run a script)
Wait for completion
However, I am getting the following error on the SSH connector (using username and password for Auth):
Hello @vpinrange
A couple of questions here to get into more details.
Which connection node are you using ? SSH Connection (Legacy) ?
Are you able to ssh to your Raspberry via Putty or other ssh client ? Not using KNIME.
Does your username is whitelisted in the /etc/ssh/sshd_config config file ? You should check for the AllowUsers line in that file, and your user should be listed there.
Also, please ensure that the sshd service is Active and Running. Use “systemctl status sshd” to check that.
Which connection node are you using ? SSH Connection (Legacy) ?
I used the standard SSH Connection node (not the legacy one)
Are you able to ssh to your Raspberry via Putty or other ssh client ?
Not using KNIME. (yes I am able to SSH into the pi using Putty as well from a mac terminal using the same user.
Does your username is whitelisted in the /etc/ssh/sshd_config config file ?
You should check for the AllowUsers line in that file, and your user should be listed there. Not sure ( the dir does not exists). I am using dropbear as my SSH server.
Also, please ensure that the sshd service is Active and Running. Use “systemctl status sshd” to check that.
I am able to SSH into the pi using putty so i know it the is running. and confirmed that it is active and running.
I’m also testing the standard SSH Connection node with user/pass and also getting errors trying to connect. But with the user/private key option I can successfully connect to my testing server using sshd.
I’ve never heard of Dropbear, but as a recommendation if I were you I’d build the connection with a public/private key pair. It is more secure.
Let me do some more testing and circle back to you.
Hi @vpinrange , for sure the issue that you are having is worth looking into, but that aside, I think the first question would be, why are you trying to use Knime to do what you are trying to do?
I am not seeing the benefits of using Knime here. And also, is there any reason why you have to do “run script, wait for completion, run script, wait for completion, etc” manually? If you add the execution of these scripts in an sh script, that wrapper script is going to automatically wait for completion of a script before executing the next script.
For example, if you are manually doing:
sh script_1.sh
(Wait for completion)
sh script_2.sh
(Wait for completion)
sh script_3.sh
(Wait for completion)
You can have a script, let’s say called run_all_scripts.sh, in which you will have
sh script_1.sh
sh script_2.sh
sh script_3.sh
And all you have to run is:
sh run_all_scripts.sh
It will run the 3 scripts one after the other.
And if you were doing “wait for completion” to see if you want to run the next script depending on the results of the previous script, you can also add these conditions in the run_all_scripts.sh script.
But back to the original point, why are you trying to use Knime to execute scripts remotely?
@bruno29a I need to get an text file with a list of values that is stored on an SMB which i have access to and iterate over that list? I was hoping to have KNIME get and parse that list and run the commands. As per your recommendation it maybe better if I just created an separate SMB for a folder on the Raspberry Pi to move this list from the other SMB and then run an sh script.
@eamendola I will try with private key to see if that works for me. dropbear is a lightweight ssh software for raspberry pi.
Hi @vpinrange , thanks for the additional info. If you are not implementing any logic or doing any manipulation of data, including for example filtering that list, I really see no reason to do this in Knime.
In terms of connecting via SSH, there should not be any problem using credentials or ssh keys. The SSH Connector supports both.
Sounds good, but SSH credentials are not working and I’m not sure why. Just curious why that is. I will test with the private key option just to see if it was an issue with creds.
As I mentioned the SSH service is running on my Pi and I am able to access using the same creds via Putty, but not from the SSH connector.
Hi @vpinrange based on the message, it does not look like it’s a credential issue, so I’m not sure that using keys would solve this issue, but I could be wrong.