2017-05-03 39 views
0

這是我一直在使用該命令將文件發送到它:我想ssh到我的覆盆子pi和使用SSHpass和SCP

sshpass -p "raspberry" scp -r [email protected]:/home/pi/Desktop/New C:/Users/Matt/Desktop/CSIndependantStudy/RaspberryPiJars/raspberryEncrypt.jar 

每當我執行命令沒有錯誤出現了,它似乎像所有的一切工作。然而,raspberryEncrypt.jar沒有被轉移到我的覆盆子pi。

當我嘗試它只有

scp -r [email protected]:/home/pi/Desktop/New C:/Users/Matt/Desktop/CSIndependantStudy/RaspberryPiJars/raspberryEncrypt.jar 

我得到提示輸入樹莓派密碼,收到此錯誤:

ssh: Could not resolve hostname c: Name or service not known 

關於如何解決這個問題的任何想法?

回答

0

在字符串C:/Users/Matt/Desktop/CSIndependantStudy/ ssh將c解釋爲主機。使用不包含Windows驅動器號的本地路徑或冒號,因爲冒號是scp中主機和路徑之間的分隔符。

+0

所以: /用戶/馬特/桌面/ CSIndependantStudy/RaspberryPiJars/raspberryEncrypt.jar我試過,即時獲取/Users/Matt/Desktop/CSIndependantStudy/RaspberryPiJars/raspberryEncrypt.jar:沒有這樣的文件或目錄 – champskee

+0

不會有。你需要一個沒有冒號的有效路徑,即相對於你正在執行命令的目錄 – camelccc

+0

你能解釋一下嗎?我不認爲我瞭解它 – champskee