這裡介紹使用方式指令範例:
代碼: 選擇全部
scp -r /usr/home/test/* username@remotehost:/usr/home/test2/
指令下達後, 將會要求輸入 username 在 remotehost 的密碼, 像是 ssh 登入的狀況一下, 如此一來, 便能方便在主機間進行檔案的複製及傳輸了.
在 windows 下若要用 scp 做 client 連往其他 linux 主機, 進行檔案複製, 可以使用 pscp, 指令幾乎是一樣的, 下載可到 putty 這裡: http://www.chiark.greenend.org.uk/~sgta ... nload.html
下載 pscp: http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe
範例指令如下:
代碼: 選擇全部
C:tools>pscp testfile.txt username@remotehost:/usr/home/test2/