Airbnb hosts were among the first to feel the financial pain wrought by the pandemic, as travel all but shut down around the globe. Many are individual homeowners, who have been told by the company to check local restrictions before booking tenants. A lot of hosts are now booking homes for eligible essential workers at free or subsidized rates, the company said in a statement. The company said it had also banned ads that market properties as escapes from the pandemic and suspended listings that violate the new policy.

“Airbnb is working with local governments in real time to both address these orders and ensure short-term and longer-term rentals are an available resource for front-line responders and those sheltering in place during this crisis,” said Josh Meltzer, head of Northeast policy for Airbnb.

Craigslist did not respond to requests for comment.

Not everyone is saying no to newcomers.

John Bigart III had been trying to sell his three-bedroom cabin in Montana for a few weeks when the virus began to take hold in New York and New Jersey. This month, he posted an ad for it on Craigslist, offering it for $195,000 and marketing it as an “off grid” getaway available “just in time for this whole coronavirus mess.”

Mr. Bigart, 48, who is also the mayor of Alberton, Mont., said he thought the post would be a good opportunity to attract potential buyers who in the past might not have considered buying property in rural Montana.

“I kind of thought that if I was in that position, and I was in a big city right now, what would be enticing to me?” he said. “And what would make me feel a little safer and allow me to get out of this box that I’m in?”

Since he posted the ad, he has received inquiries from people in New York, Nashville, Oregon, Wyoming and even cities in Montana.

But with warnings not to fly, prospective buyers have been reluctant to come view it, Mr. Bigart said.