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?

EDIT:

confirmed, commands are still in history after reinstalling OS. As others have said, maybe the image builder ran commands and forgot to clear history

  • MangoPenguin@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    29
    ·
    1 year ago

    Looks like stuff put in place by the VPS provider that would run on the first startup to create a swap partition and resize the main partition.

  • dragnucs
    link
    fedilink
    English
    arrow-up
    18
    ·
    1 year ago

    This looks like a provisioning command to expand disk to fill allocated space of your VPS.

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

    From the location of that script usr lib virt-sysprep looks to be a script put in the image by the provided to do a few things on first boot. Would have thought it was normal, but you can always ask them to double check

    • heyfrancisOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      1 year ago

      so what are the options for the customers like us if we don’t want them to access our server? how do i know if they logged in using a different method other than ssh?