7.5.4. Preserving Permissions
When
scp copies files, the destination files are
created with certain file attributes. By default, the file
permissions adhere to a umask on the destination host, and the
modification and last access times will be the time of the copy.
Alternatively, you can tell
scp to duplicate the
permissions and timestamps of the original files. The
-p option accomplishes this:
# SSH1, SSH2, OpenSSH
$ scp -p myfile server.example.com:
For example, if you transfer your entire home directory to a remote
machine, you probably want to keep the file attributes the same as
the original:
$ scp -rp $HOME server.example.com:myhome/