On the authenticity of the hadith
The hadith has been compiled by imam al-Bukhari in his al-Adab al-Mufrad and by imam al-Bayhaqi in his Sho'ab al-Iman شعب الإيمان here and here and imam at-Tabarni in his Musnad a-Shamiyyeen see here(Hopefully). Sheikh al-Albani considered it as Hassan.
Sheikh 'Ala' ad-Dyn Mughultay مغلطاي -the Egyptian hanafi hadith scholar- said in his al-Ikmal إكمال تهذيب الكمال في أسماء الرجال on the name of narrators: The issue with this hadith is the narrator Rashid ibn Sa'ad رَاشِدَ بْنَ سَعْدٍ who narrated it from Thawban many scholars say this two have not met or at least Rashid didn't hear the hadith from Thawban among those are imam Ahmad and abu Hatim and Ibrahim ibn Ishaaq al-Harbi while imam al-Bukhari holds the opinion that Rashid heard Thawban. Ibrahim al-Harbi says between the death of both there are 59 years (Thawban died 54 a.H., Rashid 113 a.H.). Imam Ahmad says about the same Thawbaan died long before Rashid a meeting is rather impossible. While abu Hatim simply says he didn't hear from him. (إكمال تهذيب الكمال في أسماء الرجال Vol 4. p 306)
Ibn Hajar said the narrator chain is not connected and al-Bayhaqi conisiders the narration as weak and so did al-Bukhari by saying it is not sound (sahih) (ad-Diraya الدراية في تخريج أحاديث الهداية). Imam Ahamd also found an issue with a second narrator of one of these compilations according to Jami* at-Tahssyl جامع التحصيل.
On the meaning of the hadith and it's interpretation
As indicated by @M.M. in the earlier answer the word "kofoor الْكُفُورَ" (plural of Kaafir كَافِرٌ similarly to disbeliever or Kafr كَفْرٍ) can refer to different meanings.
Imam an-Nawawi when commenting this hadith in Sahih Muslim in which the word "Kaafir كَافِرٌ" appears and he quoted that this word in the hadith has two possible meanings:
In the following I will translate from Arabic if no source of the translation is quoted, the translation is of my own take it with the necessary care!
وفي المراد بالكفر هنا وجهان أحدهما ما قاله المازري وغيره المراد وهو مقيم في بيوت مكة .
And about the meaning of "kofr" here there are two options: One of the is that which was represented by al-Maziri and others which refers to a person that lives in some houses (rooms) in Mekka.
قال ثَعْلَب : يقال : اكتفر الرجل إذا لزم الكفور ، وهي القرى . وفي الأثر عن عمر رضي الله عنه ( أهل الكفور هم أهل القبور ) يعني القرى البعيدة عن الأمصار وعن العلماء .
Tha'lab (I assume he refers to the linguist from al-Kufa for which I found an ARabic Wikipedia link) said: it is said: "Iktafara ar-Rajulu (a man)" if he kept himself in al-Kofoor which refers to the villages, and in al-Athar from 'omar may Allah be pleased with him (The people of al-Kofoor are the people of graves) refers to the vilages or suburbs that are far away from other (civilized) cities and scholars.
Ibn al-Athir -the historian and hadith scholar- in his an-Nihaya fi gharib al-Athar النهاية في غريب الأثر commented this hadith and added a statement of Ibrahim ibn Ishaaq al-Harbi saying:
الكفور ما بعد من الأرض عن الناس فلا يمر به أحد وأهل الكفور عند أهل المدن كالأموات عند الأحياء فكأنهم في القبور وأهل الشام يسمون القرية الكفر
AlKofoor is a place on earth which is far from (other) people, so that nobody passes around, and the people of al-Kofoor compared to the people of the cities are like the dead compared to the living people, as if they are in graves and the people of a-Shaam (The souroundings of Damscus) call village or suburb al-Kofr.
It is also said that كَفْرٍ has Syriac origins and refers to villages
So Kofoor indeed refers to villages or suburbs, but more exactly to those who are rather disconnected from the civilization (villages one would describe as at the end of nowhere in English).
And this hadith does certainly not prohibit living in villages, it just shows that it is not recommended to live isolated, as one may have nobody around to remind him of Allah if he got misguided. While in cities one may easier find guidance.
One of my major sources was this tread on alukah.