Use ssh to transfer files,
Prerequisites:
The server must enable the write permission;
Scp packages must be installed both locally and on the server;
How to transmit:
1. download files from the server;
Scp username @ servername: remote directory/local directory of file name
Example: scp root@192.168.0.101:/var/www/test.txt/var/www/local_dir
(Download the/var/www/test.txt file on 192.168.0.101 to the local directory/var/www/local_dir)
2. Download the directory from the server;
Scp-r username @ servername: local directory of the remote directory
Example: scp-r root@192.168.0.101:/var/www/test/var/www/
(Download the/var/www/test directory on 192.168.0.101 to the local directory/var/www)
3. upload local files to the target server;
Scp/local directory/file name username @ servername: remote directory
Example: scp/var/www/test.txt root@192.168.0.101:/var/www/
(Upload the test.txt file under the local directory/var/www/to the/var/www/directory at 192.168.0.101)
4. Upload the local directory to the target server;
Scp-r local directory username @ servername: remote directory
Example: scp-r/var/www/local_dir root@192.168.0.101:/var/www/
(Upload the local directory/var/www/local_dir to the/var/www/directory on the server)
Reference link:
JiangYao's Blog