It's too much of a generalisation to say rural folk are hostile and town folk are friendly.
We live in a tiny village, 2.5 miles from the nearest main road, with one Church, one pub, a Parish Hall, a little infant/primary school (with 33 kids,) and a dozen farms within 3-4 miles. It is, by a country mile, the friendliest place we have ever lived.
The cities and big towns are OK, but are often crime ridden, polluted, and noisy, and sometimes cold and hostile, and no-one has any time for anyone. And the suburbs are full of snooty people who think they're middle class, with their ludicrous 4WD 'Chelsea tractor' that they don't actually even need.
In addition, in the cul de sac we used to live in, 3 miles from a main town centre, (with homes that were privately built in the 1990's,) a bunch of frankly quite dodgy, rough people who sold their right to buy council house, move in up the road.
Sadly, they carried on living like they were on the sink estate they came from. Playing loud music, doing up cars on the lawn, having parties til 3am three or four nights a week, and yelling and screaming at each other, and anyone who gave them a look they didn't like.
People who had been there since the houses were built, started moving out, and private landlords bought the homes, and they turned into private let. Some private let folk, (like some social housing folk) are perfectly nice and decent, but some are dreadful and don't care about the house, or the area, or anyone who lives around them. Sadly, there were enough of them to ruin the area.
Our little suburban cul de sac was ruined by these entitled cunts. So we moved... And this happened to us twice. We now live in a tiny village full of mostly elderly and disabled people, and middle to upper class. Zero crime, zero break-ins, zero chavs. And the friendliest community you could possibly imagine. It's beautiful ... I will never ever move (As long as it stays like this obvs!)
So I disagree with the OP; rural folk are much friendlier. Definitely a class thing. The middle and upper classes are definitely better, more considerate neighbours...
I would suggest if you are not getting on with people in a little rural village, it is probably you, not them.............
And I agree with the posters saying that some suburbs on the outskirts of towns are soul-less. A few are OK, but many that are a cul de sac within a cul de sac within a cul de sac are just drab. And as I said, full of people who think they're middle class.