找回密碼
 註冊
搜索
查看: 436|回復: 0

[CentOS] CentOS 7 8 如何用sftp script 傳輸檔案

[複製鏈接]
發表於 2024-7-27 16:21:19 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
CentOS 7 8 用sftp script 傳輸檔案

安裝sshpass

  1. yum -y install sshpass
複製代碼
  1. export SSHPASS=your-password-here
  2. sshpass -e sftp -oBatchMode=no -b - sftp-user@remote-host << !
  3. cd incoming
  4. put your-log-file.log
  5. bye
  6. !
複製代碼



https://stackoverflow.com/questi ... rd-from-bash-script
 
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|小黑屋|TShopping

GMT+8, 2025-4-30 21:07 , Processed in 0.024799 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回復 返回頂部 返回列表