xshell最近開始套路(收費)了,SecureCRT只有破解版(涉及到版權)。在建議用戶用什麼linux遠程工具的時候犯難,最後選擇的是putty。不過putty有個弊端,就是用不了rz、sz命令上傳下載文件,很不方便。
後來查閱網上資料,發現putty提供了相關工具上傳和下載文件。
從下面這個網址下載putty,一般包含了我們這裏講的pscp、psftp(如果沒包含,這個頁面也可以單獨下載。pscp上傳下載文件,psftp上傳下載目錄)。
https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
切換到putty安裝目錄:
C:\Users\NUC>cd C:\Program Files\PuTTY
一、pscp上傳下載文件
windows上傳文件到linux下:
C:\Users\Administrator>pscp C:\Users\Administrator\Desktop\login_zh_CN.png [email protected]:/root [email protected]'s password: login_zh_CN.png | 4 kB | 4.1 kB/s | ETA: 00:00:00 | 100%
從linux向windows傳文件:
C:\Users\Administrator>pscp [email protected]:/root/login_zh_CN.png D:/test/
二、psftp上傳下載目錄
windows上傳文件到linux下:
C:\Program Files\PuTTY>psftp.exe psftp: no hostname specified; use "open host.name" to connect psftp> open 192.168.1.106 login as: root [email protected]'s password: Remote working directory is /root psftp> cd gxm Remote directory is now /root/gxm psftp> lcd d:\ New local directory is d:\ psftp> put GJY.txt local:GJY.txt => remote:/root/gxm/GJY.txt
從linux向windows傳文件:
psftp> get "GJY.txt" "D:/test/GJY.txt" remote:/root/gxm/GJY.txt => local:D:/test/GJY.txt
傳目錄的命令:put -r D:/test /root
下載目錄的命令:get -r test d:/tools/test
備註:下載到指定目錄,要指定重命名的文件或目錄,如果不重命名就用原來的文件或目錄名。
詳細請參考:https://blog.csdn.net/chen_gp_x/article/details/79299863
備註:另外putty-nd這個工具對putty進行了二次開發,直接支持上傳和下載,沒試過。