How to Generate SSH Keys in Odoo.sh
To facilitate secure and assisted identification of Odoo.sh databases, SSH Key management is a necessity for both large and small database imports. Establishing a secure connection between your local machine, and Odoo.sh, requires SSH keys. This is because they ensure communication between servers remains private and protected thus the importance of knowing how the keys are generated and managed.
In this guide we fully walkthrough setting up SSH Keys in order to automate a variety of tasks for users such as importing or exporting large database dumps.
Step 1: Create SSH Key
You first need to create a new SSH key on your computer. Open your terminal and run the following command, replacing “email@example.com” with your GitHub email address:
ssh-keygen -t ed25519 -C email@example.com
When you are prompted with “Enter a file in which to save the key”, just press the Enter to select the default file location. It creates a new SSH key pair and stores it in the default location on your machine.
Step 2: Copy and Save the Public Key
After the creation of the SSH key, it will be kept in the mentioned place on your machine. This means we are going to direct ourselves in this directory and see where the public key file is. Copy the contents of the file and paste it. This public key will be used to authenticate. But make sure that you don’t share this information and keep it safe.
Step 3: Register Your SSH Key to be used from Odoo.sh
Now take your public key from the above and login to your Odoo.sh account and navigate to your profile settings. A way to add a new SSH key to our Odoo.sh account.
Find the public SSH key you generated, copy the public SSH key, then paste that into the field provided. So be careful and paste the entire key exactly the way it is. Paste the key correctly and save your changes to finish the job.
This will associate your SSH key to your Odoo.sh account, and you will be ready to use secure and authenticated access.
Paste the public SSH key that you generated earlier in the supplied field and copy. Make sure to past the key in it’s entirety without any change. When pasting the key correctly save your changes and you’re done!
This will associate your keys with your Odoo.sh account in order to have secure, authenticated access.
Step 4: Connection Verification
To make sure that your SSH key is set up correctly, you can try to attempt to connect to your Odoo.sh instance via SSH.
Additional Use Case: Importing Large Database Dumps via SSH
For users managing large database imports (over 2GB), utilizing SSH is not just a secure option but a necessary one. After generating and adding your SSH key, use the following command to import your database:
rsync -P –inplace <zip_dump_file> <build_id>@<domain>:/home/odoo/odoosh_import_dump.zip
After the rsync upload has successfully finished, the next step is to finalize the import process within Odoo.sh. To do this, navigate to your Odoo.sh project interface, where you will find the option to complete the upload.
Locate and click on the “Import” button, which will initiate the final steps to bring your data into the Odoo.sh environment.
This action confirms that the uploaded files are correctly integrated and ensures that your data is ready for use within the Odoo.sh platform. By clicking the “Import” button, you effectively complete the data transfer, allowing you to proceed with further configurations or start using the imported data immediately.
Conclusion
With that, you can use SSH keys in Odoo.sh so you can safely do your projects. If you’re importing large database dumps or creating a secure connection, at the very least knowing about SSH keys is something that is a requirement for an Odoo.sh user.
Follow me on LinkedIn for more latest updates