One way to do that (using the DB Manager of QGIS) :
You choose Database / Database Manager / Database Manager then Virtual Layers / Qgis Layers you can then try the following query :
select points.id, min(st_distance(line.geometry, points.geometry)) from line, points
I identify one line using its id.
You get the id of the closest point ...