1. Install scp
yum install -y openssh-clients
2. Command parameters
OPTIONS:
-v has the same meaning as -v in most linux commands and is used to display progress. Can be used to view connection, authentication, or configuration errors
-C enable compression option
-P select port
-r copy directory
-v has the same meaning as -v in most linux commands and is used to display progress. Can be used to view connection, authentication, or configuration errors
-C enable compression option
-P select port
-r copy directory
3. Command
- Copy file (local >> remote): scp /cloud/data/test.txt [email protected]:/cloud/data/
- Copy file (remote >> remote): scp [email protected] :/cloud/data/test.txt /cloud/data/
- Copy directory (local >> remote): scp -r /cloud/data [email protected] :/cloud/data/
- Copy directory (remote >> local): scp -r [email protected] :/cloud/data/ /cloud/data/