I recently managed to grab a free server on Oracle Cloud.
The specs are modest:
- A 2-core processor,
- 1GB of RAM,
- and 50GB of disk space.
It’s a “weak” machine, but more than enough for some interesting projects and testing.
Don’t you think so?
In this post, I’ll share the initial configurations I made and highlight a few traps I fell into, so you don’t have to suffer through the same issues.
Post-Installation: Ubuntu 24.04 on Oracle Cloud
Once the instance is up and running, we access it via SSH using the key created or downloaded during the setup.
Critical Warning: Changing the SSH Port It’s always a good security practice to change your default SSH port (22).
However, be extremely careful! When you change the port, you must allow it in two places:
- The Oracle Cloud Web Console (Ingress Rules).
- The Ubuntu Virtual Machine firewall itself.
I initially only opened the port in the Oracle Cloud panel. After restarting the service with sudo systemctl restart ssh and logging out,
I was completely locked out!
I discovered that Oracle enables certain iptables rules by default on Ubuntu 24.04, which only allow port 22.
Make sure you update your firewall rules inside the VM before switching ports!
1. Update and Basic Tools
First, let’s get the system up to date and install some essential utilities:
sudo apt update && sudo apt upgrade -y
sudo apt install htop ufw vim nano neofetch bash-completion --no-install-recommends
Have you tried optimizing your Debian machine?
2. Securing the SSH Configuration
Access the configuration file at /etc/ssh/sshd_config:
- Port: Change from 22 to something above 1000 (e.g., 2289). Ensure the port is not in use.
- PermitRootLogin: set to
no. - PasswordAuthentication: set to
no. - PermitEmptyPasswords: set to
no. - X11Forwarding: set to
no.
Just remember!!! You need to open the port in the firewall before changing the configuration above…
Check it out the configurations above running:
sudo sshd -t
3. Activating the Service
On Ubuntu 24.04, you might need to disable the ssh.socket and enable the ssh.service directly for your custom configurations to take effect:
sudo systemctl disable --now ssh.socket
sudo systemctl enable --now ssh.service
Note: I initially had a “timed out” error even after these steps. It only started working correctly after I triggered a reboot via the Oracle Cloud dashboard.
What’s next?
Now I have a secure, accessible machine ready for action!
I’ll likely use this instance for backups or to run a monitoring service for my other servers.
If you are managing local backups on Windows as well, don’t miss my Ultimate Guide to Robocopy Commands and Examples to speed up your data transfers.
Once I decide on the final project, I’ll share it here.
Do you want a Oracle machine for yourself? Watch the video!