Hey guys, I saw this in my VPS when checking history:

    1  chmod +x /usr/lib/virt-sysprep/scripts/0001-swapoff--dev-vda2-mkswap--dev-vda2-swapon--dev-vda2-resize2f
    2  cat /usr/lib/virt-sysprep/scripts/0001-swapoff--dev-vda2-mkswap--dev-vda2-swapon--dev-vda2-resize2f
    3  vi /usr/lib/virt-sysprep/scripts/0001-swapoff--dev-vda2-mkswap--dev-vda2-swapon--dev-vda2-resize2f

here is the content of the script:

# cat /usr/lib/virt-sysprep/scripts/0001-swapoff--dev-vda2-mkswap--dev-vda2-swapon--dev-vda2-resize2f
swapoff /dev/vda2;mkswap /dev/vda2;swapon /dev/vda2;resize2fs /dev/vda1;yum -y update;systemctl disable guestfs-firstboot;reboot

This is a new server I provisioned on my VPS in racknerd. The command looks safe, but I’m wondering if these commands were executed on its own? Or someone has logged in to my VPS? This is also not normal, isn’t it?

  • glad_cat@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    9
    arrow-down
    1
    ·
    1 year ago

    I confirm that VPS companies use custom images with additional scripts. I’ve seen those a few times.

    • heyfrancis@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      wait, the 3rd command is vi. I mean that’s not an automated script, it should be executed manually, right?

      • TheInsane42@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        ·
        1 year ago

        I’d say they made the image, started it, did minor adjustments and didn’t delete the command history before stopping it and starting to deploy the image.

        Looks harmless, although a tad sloppy.

      • cooljimy84@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        ·
        1 year ago

        Good point, what happens if you run that command ? It might also just left over from when they made the custom image and forgot to clean it all up ?