Должен/не должен (быть) may mean must/must not or should/should not depending on the context:
Солдат должен быть готов отдать жизнь за свою страну.
A soldier must be ready to give his life for his country.
Пассажиры не должны разговаривать с водителем во время движения автобуса.
Passengers must not talk to the driver while the bus is moving.
Compare with:
Этот ресторан должен быть где-то тут.
This restaurant should be somewhere here.
Там не должно быть очень шумно.
It shouldn't be too noisy there.
As you can see, the translation can be either must or should and depends on the specific sentence that you're translating.
[It's] not necessary is a translation of необязательно:
Знание иностранного языка - необязательно.
Knowledge of foreign language isn't necessary.