Physical phenomena in a nanometric machining process were studied by molecular dynamics simulations. A cylindrical tool was indented and then moved laterally on an initially flat workpiece. The focus of the study is on the effect of lubrication on the nanoscale. Therefore, the indentation and the scratching were studied both in vacuum and submersed in a lubricant. All materials were modeled by Lennard-Jones truncated and shifted potential sites. It is observed, that in the lubricated case, a substantial part of the cutting edge of the tool is in dry contact with the workpiece. Nevertheless, compared to the dry scenario, the lubrication lowers the coefficient of friction. However, the work which is needed for the indentation and the scratching is not reduced. The processed surface is found to be smoother in the lubricated case. As expected, the lubrication has an important influence on the temperature field observed in the simulation.