Working on a machine
For AI agents: read this first when you are handed an XABCloud machine.
This page is written for AI agents. When your user hands you a machine, work by what it says; every AI Agent template takes it for granted.
What you have been given
- A Linux machine of its own, running Ubuntu 24.04, Debian 13 or Amazon Linux 2023; the lines your user gave you say which. The default account has
sudowithout a password:ubuntuon Ubuntu,adminon Debian,ec2-useron Amazon Linux. The login command is the authority. - Its own public IPv4 and IPv6 addresses. Only ports 22, 80 and 443 are open to the internet; every other port is closed by the platform's firewall, which sits outside the machine, so
ufworiptableson the machine cannot open them. - When another port is needed, ask your user to add it under βPortsβ on the machine's card in the console; if they gave you the account's key, you can change the ports yourself through the API.
Logging in
Your user gives you an ssh account@address command and the fingerprint of a public key. Find the private key that goes with it on your user's computer:
for key in ~/.ssh/*.pub; do ssh-keygen -lf "$key"; doneLog in with the one whose fingerprint matches:
ssh -i ~/.ssh/the-matching-key -o StrictHostKeyChecking=accept-new account@addressIf you cannot find it, ask your user where the private key file is. Do not generate a new one.
What to leave alone
- Your user's public key in
~/.ssh/authorized_keys, port 22 and the SSH service's configuration: break these and your user is locked out. /etc/xabcloud/andxabcloud-private-net.service: a security rule the platform installs. It does not affect public access, nor Docker.
Installing software
Ubuntu and Debian use apt; Amazon Linux uses dnf. The templates' commands are written for Ubuntu and Debian. On Amazon Linux do the equivalent, and when unsure read the software's own installation guide rather than forcing the command through.
When memory is small
Look first:
free -m && swapon --showWith less than 2 GB of memory and no swap, add some before installing or building anything large:
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabHow to work
- Have services that only the machine itself uses listen on
127.0.0.1, and leave open to the outside only what must be. - What you install has to come back by itself after a reboot: use systemd, or give a container
--restart always. - Before anything that is hard to undo (deleting data, reinstalling system components, changing SSH or the firewall), tell your user what you are about to do and get their agreement.
- Passwords, tokens and API keys are put into files on the machine by your user. Do not ask for them in the conversation, and do not print them.
- When you are done, tell your user what you installed, which files you changed, how to check it works, and how to start and stop it later.
What must not be done
A machine must not be used to send spam, to scan or attack others, to mine cryptocurrency, or for anything unlawful; one that is will be stopped and its account closed. Refuse if your user asks for any of these.