copy file to host from inside ssh shell code example
Example 1: how to copy directory to a ssh server
# Copy from machine a to b
scp -r /path/to/directory user@ipaddress:/path/to/destination
# Copy from machine b to a
scp -r user@ipaddress:/path/to/destination /path/to/directory
Example 2: ssh transfer file from local to remote
scp file.txt [email protected]:/remote/directory
Example 3: copy files from local to host ssh
$ scp * remoteuser@remoteserver:/remote/folder/