Problem using SSH connection within Matlab
조회 수: 15 (최근 30일)
I want to establish a SSH connection to a server and execute several commands there and I want to do that from within Matlab.
My current problem is that the connection can be established but the terminal output is written to the comand window and Matlab waits for my input. Unfortunately I do not want to trigger the commands by hand but automatically.
I tried the direct way first:
But that evoked the problem as described. So I tried to be clever and write a shell script that does the job and just trigger that script:
script = fopen('/users/leon/documents/MATLAB/script.sh','w');
fprintf(script,'#!/bin/sh \n\n ssh email@example.com ''\n who && \n exit;''');
script = fclose(script);
unix('chmod 777 script.sh','-echo');
But that yields the same result. Anybody an idea? Help is greatly appreciated!