简体   繁体   English

通过 ssh 从远程 linux 机器运行本地 python 脚本

[英]run local python script from remote linux machine over ssh

I'm trying to run a python script on a remote linux machine accessed by ssh(putty).我正在尝试在通过 ssh(putty) 访问的远程 linux 机器上运行 python 脚本。 I want to change/access directory to the windows directory and run a program which converts files on the server to csv and saves them to the server.我想将目录更改/访问到 windows 目录并运行一个程序,该程序将服务器上的文件转换为 csv 并将它们保存到服务器。

Is it possible to run the program without moving the files from remote to local, run conversion, move local to remote?是否可以在不将文件从远程移动到本地、运行转换、将本地移动到远程的情况下运行程序?

I am not the root user and can't install anything on the linux machine.我不是 root 用户,无法在 linux 机器上安装任何东西。 My Windows is 64bit and the linux machine is 64bit Ubuntu.我的 Windows 是 64 位,Linux 机器是 64 位 Ubuntu。 Any suggestions?有什么建议?

I found a way to do what I wanted.我找到了一种方法来做我想做的事。 Doing what I initially wanted requires me to transfer the files from the local machine to the remote machine then running the script and transferring it back.做我最初想做的事情需要我将文件从本地机器传输到远程机器,然后运行脚本并将其传输回来。 Ultimately it's a function of how fast my internet connection is.归根结底,它取决于我的互联网连接速度。 Since my local connection isn't that strong, I realized that my initial thoughts were flawed.由于我在当地的联系不是那么紧密,我意识到我最初的想法是有缺陷的。 Eventually, I just uploaded my data to the remote machine and run the script there.最终,我只是将我的数据上传到远程机器并在那里运行脚本。 It was the fastest solution这是最快的解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM