How to establish shh from Matlab (or how to start programm on remote computer by sending the matlab command on Windows)
39 views (last 30 days)
For my experiment I need to send the command from matlab (which is running on windows) to the linux (running on the remote computer).
The first idea was to use putty and to find the way how to send the command from matlab to putty. But I found no solution for this problem.
In matlab community I found ssh2 function which is looking useful. But if I put in the command window
- ssh2_simple_command('username@name_of_pc','username',passwort','ls -la *ninjas*')
I receive an error “SSH2 could not connect to the ssh2 host - ‘username@name_of_pc'.
I would be very grateful if you could give me an advice, how to solve this problem.
Many thanks in advance
Rashed Mohammed on 8 Mar 2021
It seems that remote computer is not accessible from your computer. I've tried the command you've mentioned and it worked perfectly fine for me. Please verify whether remote computer is accessible from your computer or not using the command "ping <remote_computer_hostname>". If the previous command doesn't give error, then try SSH'ing using other software such as Putty to check if it is a problem with MATLAB only.
Hope this helps