rpm -qf <path/to/file> pkg which <path/to/file> dpkg-query -S <path/to/file>
Running the commands on CentOs and Ubuntu to find which package created /etc/ssh/ssh_config will look like this:
rpm -qf /etc/ssh/ssh_config openssh-clients-5.3p1-124.el6_10.x86_64
dpkg-query -S /etc/ssh/ssh_config openssh-client: /etc/ssh/ssh_config