The second translation isn't correct (ask any student of law ;) ). "Man soll hier nicht schwimmen" = "One is not supposed to swim here" - vs. - "One is not allowed to swim here" = "Man darf hier nicht schwimmen", "Schwimmen ist hier verboten". And "Man sollte nicht ..." = "One should not ...".
I think that "You can't sleep here" is more like "Ihr dürft hier nicht schlafen" ("you mustn't", "it's not allowed"), or you could even say "Ihr könnt hier nicht schlafen" and still retain the connotation ("Get out, tourists! You can't sleep in my garden! Get a hotel room!").
Leaving aside contexts like the Ten Commandments ("thou shalt not" = "du sollst nicht" = "you mustn't" - I'm starting to wonder if this is where people's confusion over "sollen" comes from) which aren't a good example of modern-day commonplace German, "sollen" either appeals to "what a good guy/girl is expected to do" or says "what action is intended to happen" or "what the rumour is". So it's quite different from "you can't".
"Ihr sollt hier nicht schlafen" really is "You're not supposed to sleep here": "But our teacher said you're not supposed to sleep by the campfire!", "This is a university lecture, you're not supposed to sleep here, but to pay attention."
"Du sollst Max nicht die Puppe wegnehmen!" = I've probably told you this before, I want you not to take Max's doll from him, because that's not what a good girl does.
"Du sollst lernen, nicht fernsehen!" = "You're supposed to be learning, not watching TV!"
"Du solltest doch um Mitternacht zu Hause sein!" "You were supposed to be home by midnight!"
"Auf dem Platz soll ein Denkmal aufgestellt werden." = We're making plans to rebuild the square and we intend to have a monument erected there.
"Der Schauspieler soll sehr krank sein" = The rumour goes that the actor is very ill.
"Die entstandenen Umweltschäden sollen ausgeglichen werden." = The damage this newly-built road imposes on the environment "should" be compensated for - we declare that this is the theoretical intention, but it doesn't mean we (or: you) actually have to do it and you can't sue us (or: we can't sue you) if we (or: you) don't.
Another example: a cop talking to a group of homeless persons.
"Sie dürfen hier nicht schlafen" = it's forbidden to sleep here (I wouldn't imagine this to be said in a friendly tone)
"Sie können hier nicht schlafen" = it's not allowed for you to sleep here, there's regulations against that (this can be said in a friendly tone, more like an information) - or - this place is too cold to sleep in, you can't seriously plan to sleep here
"Sie sollen hier nicht schlafen" = it's not in my power to detain you from sleeping here, but you're not supposed to do it
"Sie sollten hier nicht schlafen" = you shouldn't sleep here because it'd be wise to sleep somewhere else (e.g. because there's some kind of danger here)
"Sie müssen hier nicht schlafen" = you don't have to sleep here, you have other options
I have the same question. But my best guess is if it were "Ihr sollt nicht hier schlafen" the meaning of the sentence would be: "You shouldn't sleep here (but some other place/location)"; the location (hier) is the emphasis of negation. Whereas Dulingo's sentence, "Ihr sollt hier nicht schlafen" might mean something like: You shouldn't sleep here (but some other action/activity)"; the action (schlafen) is the emphasis of negation.
In English we create such emphasis using rising intonation. Try saying "You shouldn't SLEEP here" and then "You shouldn't sleep HERE" pronouncing the words in uppercase with rising intonation for emphasis. Can you sense the shift in meaning?
I could be wrong :)