2016-05-04 219 views
0

我與我的Windows CMD連接到另一臺機器上使用此命令:我來補充運行後,一個簡單的命令和斷開執行命令膩子SSH

putty.exe -ssh [email protected] -i C:\Users\Administrator\Desktop\bobPrivate.ppk -pw mypass 

和選項?

+1

[自動化使用的PuTTY從Windows上運行Linux命令]的可能的複製(http://stackoverflow.com/questions/6147203/automating-running-command更換路徑-on-linux-from-windows-using-putty) – CherryDT

+0

不,它是Windows到Windows – jofri

+0

如果你有一臺運行在另一臺機器上的SSH守護進程,它並不重要。請在另一個線程中查看答案。如果你的問題在於首先通過PuTTY進行連接(所以你甚至不需要*在另一端有一個SSH代理),那麼你可能正在尋找['psexec'](https://technet.microsoft .com/en-us/sysinternals/psexec.aspx)。 – CherryDT

回答

0

要執行,你必須使用-m選項的命令。

putty.exe -ssh [email protected] -i C:\Users\Administrator\Desktop\bobPrivate.ppk -pw mypass -m C:\Path\to\file\with\commands 

你必須與你的