Smart way to copy multiple files from different paths usinc scp

后端 未结 5 865
北荒
北荒 2021-02-08 13:04

I would like to know an easy way to use scp to copy files and folders that are present in different paths on my file system. The ssh destination server requests a password and I

5条回答
  •  借酒劲吻你
    2021-02-08 13:10

    Alternatively, if you cannot use public key authentication, you may add the following configuration to SSH (either to ~/.ssh/config or as the appropriate command-line arguments):

    ControlMaster auto
    ControlPath /tmp/ssh_mux_%h_%p_%r
    ControlPersist 2m
    

    With this config, the SSH connection will be kept open for 2 minutes so you'll only need to type the password the first time.

    This post has more details on this feature.

提交回复
热议问题