The SSH connection
With the SSH connection, Copilot sends commands to the store’s server: clearing a cache, running a PrestaShop console command, reading an error log. Each command is prepared, approved by you, executed, then recorded.
Before you start
- Developer mode must be active on the store.
- You need SSH access to the server: its address, the port (22 most of the time) and a user.
Authentication is by key only: Copilot neither asks for nor keeps any password.
Adding Copilot’s key to the server
- In the store settings, open SSH connection, fill in the Server, the Port and the SSH user, then save.
- Copilot displays Copilot’s key for this store, as a line to copy.
- On the server, add this line, as it is, to the end of the
~/.ssh/authorized_keysfile of the user you entered.
For example, logged in to the server as that user:
mkdir -p ~/.ssh && chmod 700 ~/.ssh
echo "THE LINE COPIED FROM COPILOT" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
- Go back to Copilot and click Test the connection.
The server fingerprint
On the first test, Copilot reads the server’s fingerprint and pins it. Compare it with your server’s:
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
It is then checked at every command. If it changes, Copilot stops and asks you to confirm the new fingerprint — only do so if you yourself changed or reinstalled the server.
The terminal
When the connection is active, a terminal opens in Copilot. You can type a command yourself, or ask for it in the conversation: “Clear the production cache”, “Show the last twenty lines of the error log”.
Changing or removing the key
Generate a new key replaces the key: the old one stops working, and the new line must be added to the server. Delete the SSH connection erases the key and the fingerprint; remember to remove the line from the authorized_keys file.
FTP or SSH?
If your hosting offers SSH, prefer it for commands. FTP access is for files, and is enough on shared hosting without SSH. Both can be active at the same time.