1

In my virtual server, ssh is not on port 22, I don't allow login with passwords, and I don't allow root logins.

Recently, the server was not responding. My hosting company told me that my Apache config was allowing too many concurrent users so they changed it.

When I logged in, the shell greeted me saying that the last login was by myself, 8 hours earlier.

How did they access and modify a file in this system?

Do virtual machines allow exploring the file system and modifying files?

aBe
  • 113
  • 4
  • 4
    Welcome to the world of virtualized servers, in OpenVZ, I can log into the parent, and change a file on any guest without having to know anything about the passwords or access methods of the guest. – NickW Mar 21 '14 at 13:35
  • Magic... Really! – ewwhite Mar 21 '14 at 13:56
  • Thank you for your explanations. I had assumed that if I upload private files to non-www folders on my vserver only I would be able to access them. Very good to know. I wonder how many people will also get this wrong. – aBe Mar 25 '14 at 10:06

2 Answers2

5

As already noted by @NickW you might just have encountered a change to the container that is your "virtual server".

In OpenVZ - a technology to provide low overhead virtual Linux-based servers - a VM (commonly refered as a Virtual Private Server) is just a jailed "slice" of the host operating system, much like a jail in FreeBSD.

Thus, if you have full access to the host, you can actually access the contents of the Virtual servers file system directly without having to login to the guest OS.


This is not exclusive to container-based virtualization.

Virtual machine storage is usually just files in the file system of the host machine, but where most hypervisors would require you to shutdown the VM and detach the virtual disks to edit the contents of the disk, the container-approach allows "live access" to the files in the virtual container

Mathias R. Jessen
  • 25,161
  • 4
  • 63
  • 95
  • 2
    As an example, if I'm the host I can enter `vzctl enter {VM_ID)` and I get dropped into your VM with a root shell on an OpenVZ server. – Jacob Mar 21 '14 at 16:23
0

Most of the time, the disks of any virtual server consists of a big file in the filesystem of the host server, which can therefore be mounted on the host server like an USB or DVD.

Sometime it can be a partition, logical volume, ... directly addressed by the VPS. In this case also it is possible to access it without problem from the host server.

Benoit
  • 396
  • 2
  • 10