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
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.