To manually upload an SSL certificate using SSH, follow these organized steps:
- Connect to your server via SSH:
- Open a terminal on your local machine.
- Type the command:
ssh user@example.comwhereuseris your username andexample.comis your server's hostname.
- Navigate to the appropriate directory:
- Create a new directory for SSL files (optional):
- Create an empty file for the SSL certificate:
- Copy the SSL certificate contents to the server:
- Copy the SSL certificate from your local machine to the terminal.
- Press
Ctrl+Dto save the file.
- Verify the SSL certificate:
- Repeat for CA bundle and private key (if needed):
- Create files for each additional required file (e.g.,
ca_bundle.crtandprivate_key.pem). - Upload their contents similarly.
- Create files for each additional required file (e.g.,
- Check for errors:
- Ensure all files are correctly formatted without extra spaces or lines.
Remove any empty or incorrect files using:
rm -f /etc/ssl/certs/file_name
Check if the file was created correctly by viewing its contents:
cat /etc/ssl/certs/server.crt
Use cat >> /etc/ssl/certs/server.crt and paste the content, ensuring no extra lines are added:
cat >> /etc/ssl/certs/server.crt
Use touch to create an empty file, e.g., server.crt:
touch server.crt
Create a subdirectory within /etc/ssl:
mkdir -p /etc/ssl/certs
Use the cd command to move to the desired location, such as certificates:
cd /etc/ssl/certs
