37

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?

all 14 comments
sorted by: hot top controversial new old
[-] MangoPenguin@lemmy.blahaj.zone 29 points 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@lemmy.ml 15 points 1 year ago

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

[-] Cooljimy84@lemmy.world 11 points 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

[-] glad_cat@lemmy.sdf.org 11 points 1 year ago

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

[-] heyfrancis@lemmy.ml 1 points 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 14 points 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 3 points 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 ?

[-] chiisana@lemmy.chiisana.net 1 points 1 year ago

Perhaps it is listed in reverse chronological order; edit, check content, change permissions (for deployment)?

[-] heyfrancis@lemmy.ml 2 points 1 year ago

good point, it's just a test server for now so I'll try to reinstall OS and check if same commands will show in history

this post was submitted on 06 Aug 2023
37 points (97.4% liked)

Selfhosted

40183 readers
406 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS