How to Increase Odoo Security in 1 commandline?
· Knowledgebase, Odoo, Post Installation
How to Increase Security in Odoo Installations
By default Odoo is built and deployed on Linux and Ubuntu, these mitigates a lot of issues with Long Term Support, taking extra steps will increase odoo security from Day One, this will go a long way in the future
Objective:
- Ubuntu Servers on the internet are bound to get attention , especially via IP and SSH
What Do You Need to do this?
- Access to the Ubuntu server, we use SSH keys, pls generate your own SSH keys from your machine and share with Admin
- Server IP to access to
Quick Checklist
Backup the server
SSH to server
Add a Script to enable UFW and check only SSH access is allowed via keys
Restart server and check the Odoo
Steps to Reproduce:
-
Create a backup or snapshot of the server, as a fallback in case things do not work
-
SSH into the server
-
Copy in the following command:
cat <
configure-ufw-ssh.sh apt install ufw -y ufw allow ‘Nginx Full’ ufw allow ssh sudo ufw enable sudo ufw status
sed -i ’/#PasswordAuthentication yes/c\PasswordAuthentication no’ /etc/ssh/sshd_config sed -i ‘/PasswordAuthentication yes/c\#PasswordAuthentication no’ /etc/ssh/sshd_config service sshd restart
EOF
-
Then type in
chmod +x configure-ufw-ssh.sh
-
Then type in
./configure-ufw-ssh.sh
-
Check and login the odoo via web, to ensure things are working
-
If things are not working, consider restoring the snapshot or backup in Step #1
More on Odoo Customization
4 Things to Know Before Customizing Odoo
Read more →Odoo 19: "A css error occured, using an old style to render this page"
How we chased Odoo's "A css error occured, using an old style to render this page" banner back to its real root cause — and why every Odoo install belongs in its own virtualenv.
Read more →