Undo changes and recover from a lockout
Every apply is one transaction, journaled in /var/lib/vps-ready. You can undo it at any time, whether or not the safety timer is still running.
Undo the last apply
Section titled “Undo the last apply”sudo vps-ready rollback --last--last picks, in this order: an apply that was interrupted part way, then one that is waiting for a confirm, then the newest one that was applied or confirmed. The rollback prints each step and a summary:
remove /etc/apt/apt.conf.d/52vps-readyrestore net.ipv4.conf.all.accept_source_route = 1restore fs.protected_regular = 0restore fs.protected_fifos = 0restore kernel.unprivileged_bpf_disabled = 0restore kernel.dmesg_restrict = 0restore kernel.kptr_restrict = 0remove /etc/sysctl.d/90-vps-ready.confRolled back transaction 20261023T190556Z: restored 8 changes.Rolling back a transaction that waits for a confirm also stops its safety timer.
Undo an older apply
Section titled “Undo an older apply”List the transactions, newest first, then pick one by ID:
sudo vps-ready history20261024T081500Z applied kernel.sysctl,updates.auto 8 changes20261023T190556Z rolled-back (manual) kernel.sysctl,updates.auto 8 changessudo vps-ready rollback --txn 20261024T081500Zhistory --json prints the same list for scripts.
When rollback refuses
Section titled “When rollback refuses”A manual rollback is all or nothing, so it refuses (exit code 2) rather than undo half a transaction:
- A file changed since
apply. vps-ready will not overwrite an edit you made after it. Put the file back, or undo your edit, and run it again. - It would remove your own account. You cannot roll back the admin user while you are logged in as that user. Log in as another user with sudo.
- A later apply depends on it. An admin user cannot be removed while a later transaction is applied, confirmed or waiting, since that one may have turned off root and password logins. Roll back the later one first.
If a rollback starts but cannot finish, it exits 3 and says what is left to do by hand, for example when userdel fails because the admin user still has processes running.
Locked out?
Section titled “Locked out?”First, breathe: if you just ran apply with a profile and have not confirmed yet, the safety net is still armed. Work down this list.
-
Wait for the timer. If the change is still waiting for a confirm, it rolls back on its own at the deadline (5 minutes by default). Then log in the way you did before.
-
Use a session that is still open. The terminal you ran
applyin keeps working after the change. From there:sudo vps-ready rollback --last -
Reboot from your provider’s control panel. If the change has not been confirmed, a reboot rolls it back before the SSH server starts. After a confirm, a reboot changes nothing: the changes are kept.
-
Use your provider’s web console (or serial console). It logs in locally, without SSH or the firewall. Run
sudo vps-ready rollback --lastthere. The console cannot confirm a change, but it can always roll one back. -
Last resort: the provider’s rescue system. Each transaction keeps what it wrote and the original files in
/var/lib/vps-ready/txn/<id>/:journal.jsonllists every change, andfiles/<n>.beforeholds the original bytes, so you can put files back by hand from a mounted disk.
If vps-ready ever leaves you locked out, that is a security bug. Please report the lockout, or for anything sensitive use private vulnerability reporting.
Feedback
Questions, ideas or problems with vps-ready.