Execute remote Linux server script from Windows

来源:互联网 发布:好玩的社交软件 编辑:程序博客网 时间:2024/05/16 11:38

Today, I try to execute the shell script from Windows via putty, and the script is storted in remort server Linux.

When I try the below command, it prompt a error message.

Command line:

C:\Software\PuTTY\putty -ssh <username>@<remote server> -pw <password> -m /home/users/remoteCall.sh

Error:

unable to open command file "/home/users/remoteCall.sh"

After refer much info, for the command line:

putty [-pw password] [-m file] user@ip_addr

-m file: the file is storted in the local of  Windows, and write the batch shell command in it.

Here I just add a command for call the remote script

/home/users/remoteCall.sh

And now run the command in the cmd of windows:

C:\Software\PuTTY\putty -ssh <username>@<remote server> -pw <password> -m C:\remoteCall

Reference: http://the.earth.li/~sgtatham/putty/0.54/htmldoc/Chapter3.html#3.7

 

BTW, I remember I have ever tried to call the remort program from Windows by the same command. But now it's so strange for the error.

If anyone know that, please tell me.