[問題] 從伺服器端下載檔案到本機端

看板Linux作者 (一步一腳印)時間13年前 (2011/07/03 10:59), 編輯推噓3(307)
留言10則, 4人參與, 最新討論串1/1
通常要從伺服器端下載檔案, 不是用sftp就是scp: user@local_host$ scp user@remote_host:my_file . 假設已經ssh到伺服器端了, 有沒有更簡潔的指令能把檔案傳到本機端? user@local_host$ ssh user@remote_host Welcome to remote_host! user@remote_host$ ssh_get my_file . user@remote_host@ exit logout Connection to remote_host closed. user@local_host$ ls my_file 有類似ssh_get, ssh_put這種指令嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.31.149

07/03 14:44, , 1F
從遠端scp自己?
07/03 14:44, 1F
user@remote_host$ scp my_file user@local_host: ^^^^^^^^^^ 這邊要打什麼?

07/03 16:31, , 2F
打你自已機器的hostname或ip 若想少打一些字 就用個alias
07/03 16:31, 2F

07/03 16:31, , 3F
或 shell script等
07/03 16:31, 3F
我本機端的public ip是多人共用...

07/03 16:39, , 4F
檔案都只是資料串流,ssh只是個連線方式,讀過來即可
07/03 16:39, 4F
??

07/03 17:01, , 5F
不知lftp有沒有辦法...
07/03 17:01, 5F

07/03 17:05, , 6F
找到了,哈,參考以下網址
07/03 17:05, 6F


07/03 17:05, , 8F
$ lftp sftp://account@host -p [port]
07/03 17:05, 8F
感謝 不過這樣連線後預設只能用lftp內建的指令 雖然可以靠"!"使用原本Linux指令 但實在不甚方便 而且alias或自訂的function都不能用了(似乎是因為lftp不會source ~/.bashrc) ※ 編輯: Holocaust123 來自: 140.112.31.149 (07/03 17:49)

07/03 18:07, , 9F
因為資安問題的考量,lftp的目的在於拿與放資料呀
07/03 18:07, 9F

07/05 02:48, , 10F
資料流方式 ssh xxx@yy "cat zzz.xyz" > zzz.xyz 了解?
07/05 02:48, 10F
文章代碼(AID): #1E3ziCwR (Linux)