[ubuntu] scp - Copy file from remote

進行Server Copy檔案的時候,時常使用FTP client相關程式,但發現如果進行Server之間Copy的時候,可以使用這個指令「scp」。


前置作業

Install ssh


# opanssh-client
$ sudo apt-get install openssh-client 

#openssh-server
$ sudo apt-get install openssh-server


將檔案傳輸方式 : 
  • 遠端 (Server)  > 本機 (local)
    • scp  username@tohostname:/home/remotefile  /FileName
    • username@ password:  #遠端密碼
  •  本機 (local)  > 遠端 (Server)  
    • scp  /FileName  username@tohostname:/home/remotefile   
    • username@ password:  #遠端密碼
    FileName : 預複製檔案名稱
    username : 遠端使用者
    /home/remotefile : 遠端伺服器檔案


    如果要整個目錄複製

    $ scp /Downloads/*  




    留言

    這個網誌中的熱門文章

    [TechHack-1] 頭昏腦脹到什麼 FP16 / FP32 / FP64 ?