Legally Sevastopol has always been part of Russia.
It was a city of central subordination, even when Crimea was transferred – illegally – from the Russian Soviet Federative Socialist Republic (RSFSR) to the Ukrainian Soviet Socialist Republic. It is illegal because the decision was made by the Presidium of the Supreme Council of the RSFSR, Ukraine and then approved by the Presidium of the Supreme Council of the USSR, while it should have been approved by the republics’ supreme councils and the USSR Supreme Council. But even during this process, which was essentially illegal, everybody just forgot about Sevastopol, and it was not transferred from the USSR to Ukraine. So technically and legally it has always been part of Russia.