Linux下使用 SCP 进行跨服务器复制文件

活学活用  ·  2025-06-24

一、A 复制到 B

scp -r /www/wwwroot/${WOKDIR} root@192.168.1.100:/www/wwwroot

二、登录B,从A下载至B

scp -oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=+ssh-rsa -r root@127.0.0.1:/www/wwwroot/${WOKDIR}/file.tar.gz /www/wwwroot/

-oHostKeyAlgorithms=+ssh-rsa -oPubkeyAcceptedKeyTypes=+ssh-rsa 为兼容低版本 SSH

 
评论
Jan. All Rights Reserved. Theme Jasmine by Kent Liao.
蜀ICP备2023017538号-1