關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 透過 SSH 傳送檔案

    Posted on March 13th, 2006 Sam Tang 5 comments

    在兩台主機間傳送檔案時,用 ftp 指令很方便,但另一個較為安全的做法是透過 SSH 來傳送,而且使用上十分簡單 ,只要使用 scp 指令則可。

    假如你要把 /home/samtang/ 目錄下所有 .php 副檔名的檔案,傳送到主機 192.168.1.100 的 /var/www/ 下面,登入名稱是 user1,可以輸入:

    scp /home/samtang/*.php user1@192.168.1.100:/var/www/

    然後系統會詢問你連接密碼,輸入正確密碼後就可以傳送了,但當然用來傳送的帳號需要有合法權限在遠端目錄寫入資料。


     

    5 responses to “透過 SSH 傳送檔案”

    1. hsftp, gftp, ssh:// in nautilus…

    2. and:
      lftp -u username sftp://ssh.host/

    3. nice one!
      比 FTP 方便很多!

    4. [...] 透過 SSH 傳送檔案 (tags: Tech Network SSH SCP) [...]

    5. [...] 透過 SSH 傳送檔案 – Real-Blog [...]

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word