Skip to content

Instantly share code, notes, and snippets.

@eric-lopez
Created January 15, 2016 22:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eric-lopez/d0321112cc1678566c7e to your computer and use it in GitHub Desktop.
Save eric-lopez/d0321112cc1678566c7e to your computer and use it in GitHub Desktop.
backdoor astara qcow image
To backdoor an astara qcow image:
1. Download astara image qcow image
2. As root, enable Network Block Device in Kernel
% modprobe nbd
3. As root, create a network bood device of the qcow image with QEMU NBD tool:
% qemu-nbd -c /dev/nbd1 astara.qcow2
4. As root, Mount the create network boot device to the filesystem:
% mount /dev/nbd1p1 /mnt
5. As root, change root directory for shell instance to the mount point
% chroot /mnt
6. Add new user to base image
% useradd <username>
7. Set password of the user:
% passwd <username>
8. Add sudo privelages for new user:
% vi /etc/sudoers.d/90debuguser
'<username> ALL=(ALL) NOPASSWD:ALL'
9. then umount network device from filesystem and device tree:
% umount /mnt
% qemu-nbd -d /dev/nbd1
10. upload astara.qcow2 to glance
11. update orchestraotr.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment