When working with servers, secure file transfer is a routine but critical task. This guide explains how to transfer Traccar files, configuration files, and SSL certificates between servers using scp, and how to place them in the correct directories.
Note :Always try to tranfer singlefile or zip file not directory or folder because it would crash
how to go tmp file
cd /tmp
Understanding SCP Syntax (Most Important)
scp [options] SOURCE DESTINATION
Rules:
SOURCE → Where the file currently exists
DESTINATION → Where the file should be copied to
user@ip:/path means remote server
/path alone means local server
-r is used for directories
- Copy Traccar Directory to Remote Server Command
scp -r traccar ubuntu@13.126.68.234:/tmp
Explanation
SOURCE: traccar (local directory)
DESTINATION: /tmp on server 13.126.68.234
Result:
/tmp/traccar
in server first type
cd
cd /tmp
Copy Traccar ZIP Package to Remote Server
scp traccar-linux-64-6.8.1.zip ubuntu@13.126.68.234:/tmp
Explanation
SOURCE:
traccar-linux-64-6.8.1.zip (local file)
DESTINATION:
/tmp on remote server
- Move Traccar ZIP to /opt Directory (on Remote Server) Command (run on remote server)
sudo mv /tmp/traccar-linux-64-6.8.1.zip /opt/
Explanation
SOURCE: /tmp/traccar-linux-64-6.8.1.zip
DESTINATION: /opt/
Used after SCP to place files in system directories
- List Contents of Traccar ZIP (Without Extracting) Correct Command
tar -tf traccar-linux-64-6.8.1.zip
Explanation
Lists files inside the archive
Does not extract anything
- Copy Traccar Configuration XML File Command
scp traccarjp.xml ubuntu@13.126.68.234:/tmp
Explanation
SOURCE: traccarjp.xml (local)
DESTINATION: /tmp on remote server
- Copy SSL Certificate Files to Remote Server Commands
scp fullchain.cer ubuntu@13.126.68.234:/tmp
scp traccar.motoshare.in.cer ubuntu@13.126.68.234:/tmp
scp traccar.motoshare.in.key ubuntu@13.126.68.234:/tmp
Explanation (same for all)
SOURCE: Certificate file on local machine
DESTINATION: /tmp directory on remote server
- Move Traccar Configuration into Correct Directory Command (run on remote server) sudo mv /tmp/traccar.xml.mysqlbac /opt/traccar/conf
Explanation
SOURCE: /tmp/traccar.xml.mysqlbac
DESTINATION: /opt/traccar/conf
Used to activate Traccar configuration
- Move SSL Certificates to Apache Certificate Directory Commands (run on remote server)
sudo mv /tmp/fullchain.cer /opt/lampp/etc/certs/traccar.motoshare.in
sudo mv /tmp/traccar.motoshare.in.key /opt/lampp/etc/certs/traccar.motoshare.in
sudo mv /tmp/traccar.motoshare.in.cer /opt/lampp/etc/certs/traccar.motoshare.in
Explanation
SOURCE: /tmp/*.cer or /tmp/*.key
DESTINATION: /opt/lampp/etc/certs/traccar.motoshare.in
This directory is used by Apache for SSL
- Quick Reference Table (Source → Destination)
Top comments (0)