But the move has been branded “draconian” by political opponents with a warning that it may even be “illegal”.
Scots who breach the ban could face a £60 fine or even prosecution in serious cases – although police are expected to take “last resort” approach to enforcement, with a focus on advising and encouraging compliance.
The decision was confirmed as Ms Sturgeon revealed 11 council areas are to be moved into level four - the strictest set of Covid restrictions for a "short, sharp" three-week spell.
And Ms Sturgeon said the current guidance on not travelling in or out of these areas, which also applies to a further nine areas of Scotland in level three, will now be enshrined in law.
The First Minister said the "targeted approach" being adopted in Scotland, through the five-tiered system, depends on people not spreading the virus from "high to low-prevalence areas".
Ms Sturgeon said: "That becomes even more important with parts of the country in level four.
"To put it bluntly - and we will require to monitor this - if we see evidence that people from East or South Ayrshire are visiting places in North Ayrshire, or that people from Glasgow are going to Inverclyde, we would have no choice but to put these areas in level four too.
"So it is essential that we all abide by travel restrictions.
"To underline how important this is, I can confirm that the guidance that has been in place in recent weeks will become law from Friday."
Scots living in level three or level four areas will be breaking the law if they travel outside their own council area, except for certain essential purposes.
Similarly people living elsewhere in Scotland must not travel to level three or level four areas from Friday.
Ms Sturgeon said: "There must be no non-essential travel between Scotland and other parts of the UK."
"I know this is difficult, but it is essential.”
Scots who breach the travel ban could be issued with a fixed penalty notice for £60, reduced to £30 if paid within a month. Subsequent breaches will see the fine double to a maximum of £960. In serious cases, the person could be prosecuted and subject to a court imposed fine.
Liberal Democrat MSP Mike Rumbles hit out at the measure.
"For the very first time, the First Minister intends by regulation to make illegal to travel from one areas to another," he said.
"This is without the authority of Parliament and may very well be illegal since this is unenforceable and may not be a proportionate measure in law.
"Does she not understand that these draconian changes in law - and I think everybody would agree they are draconian in the truest sense of the word - that these draconian changes in law should be a decision not made by her alone, but made by Parliament and made by Parliament before such measures come into effect?"
But Ms Sturgeon said the Government would seek to bring the regulations giving effect to the travel ban before MSPs on Thursday, the day before they come into force.