They're not actually user stories. They're stakeholder stories. Unless the software is actually paid for direct by users, it's rare that a story is created entirely for their benefit.
I give you a couple of examples:
- keyworded articles, which allow advertisers to have more effective adverts
- CAPTCHAs, which are there to stop moderators having to deal with spam manually.
Most technical stories actually provide a business benefit, but it's rarely for the users. Phrasing them in a different way can help. I normally use Chris Matts' Feature Injection template:
In order to <achieve my goal> As <the stakeholder who wants the goal> I want (<some users to do>) <some stuff>. This explicitly recognises all kinds of stakeholders, including the development team. Now you can phrase your technical stories too, calling out the business benefit:
In order to minimize the risk of deploying something broken>broken As the team deploying the code We want to spend a few days on an automated deployment system. I've written a couple of blog posts on this: They're not User Stories, and Feature Injection and handling technical stories. Hope they help.