The UN Charter had no measure written into it for what to do if a permanent member of the Security Council were to cease to exist. As such, there was a bit of confusion about what to do when the USSR was dissolved. However, what was clear was that there had to be some sort of succession of the USSR on the Security Council in order to maintain the integrity of the charter.
Russia was of course the original and biggest part of the USSR, so it simply made the most sense for them to be the successor of the USSR on the council. This was pretty widely agreed upon by the newly created former Soviet republics, all but one eleven of who signed the Alma-Ata declaration of the Commonwealth of Independent States in December of 1991, part of which stated that they supported the succession of Russia on the Security Council. There was no objection to the request from the rest of the member states, so that was the action taken.
Under international law the Russian Confederation is recognized as the successor state to the Soviet Union.