I'm using a remote system to run C code to generate data, and then I want to use a local copy of matlab to analyze that data. Is it possible to SSH into a remote server with matlab and read data files for analysis? Unfortunately the remote server is a supercomputing cluster and doing trivial analysis of the data means having to wait in a queue for other more intensive computations to complete, so I'd like to analyze the data locally if possible.

 채택된 답변

Walter Roberson
Walter Roberson 2011년 9월 30일

0 개 추천

Consider using
system('scp RemoteSystem:/path/to/remote/file /path/to/local/file')

댓글 수: 4

CP
CP 2011년 10월 5일
Sorry I didn't get back to this as i was out of town. The reason I wanted a way to do it from within matlab is because I do the analysis from a variety of different platforms, and while this will work on the Mac and Linux platforms, when I'm on a windows machine I don't think that will work (right?)
Walter Roberson
Walter Roberson 2011년 10월 5일
I believe you can get an scp equivalent for Windows, such as in the PuTTY package.
ssh itself is not going to offer any method for you to transfer files.
Would it be plausible for the cluster to serve the files via a web server with https ?
CP
CP 2011년 10월 5일
Sorry yeah, scp is what I meant, I think of them as the same thing. The cluster is pretty protected and doesn't serve anything to machines outside the immediate network nor allow external connections of any kind (including SSH and SCP) that are not in the immediate network, so I highly doubt it has an http server. I get around this by SSH to a different computer in the network, then SSH or SCP as needed from that session into the cluster. So SCP is probably the only way to do it, but I guess matlab can't on its own connect remotely via SCP? As far as windows yes, I do know how to SCP from windows so I guess I could just do a system(pscp.exe stuff) command on the windows version of the script.
Walter Roberson
Walter Roberson 2011년 10월 5일
MATLAB does not have scp support built in -- e.g., you cannot use scp: as a URI.
It would likely be possible to use loadlib() or build a mex interface to communicate between MATLAB and scp.
I would not anticipate that anyone would bother to implement scp in pure MATLAB, as it is a complicated protocol with many security risks if it is not implemented by people familiar with securatizing programs. MATLAB is, though, really not designed for securatizing programs.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Ayush Pandey
Ayush Pandey 2015년 6월 15일

0 개 추천

I am having the same problem since many many days now. Can somebody guide me to achieve the thing as mentioned in the main question. Currently, I have access to the remote files via SSH. (On Ubuntu Linux 14.04, MATLAB R2015a)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

CP
2011년 9월 30일

답변:

2015년 6월 15일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by