How to transfer a file between two remote servers using scp from a third, local machine?

后端 未结 6 509
小鲜肉
小鲜肉 2020-12-24 03:04

I\'m trying to copy a file from one remote server to another remote server from my local machine. Here\'s what I\'m trying

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-24 03:29

    If you can ssh to both remote servers from your local (local -> remote1 & local -> remote2), then you could try:

    ssh -A -t user1@remote1 scp srcpath user2@remote2:destpath
    

    This will transfer straight from remote1 to remote2 using your local credentials all the way.

    If you do not want to be asked for passwords, then you should set up the authorized_keys file on remotes.

提交回复
热议问题