Yes, it is possible
It is actually possible to obtain a permanent skeleton companion. That being said, it is a slightly convoluted process that is not without certain shortcomings. This method involves using two spells in conjunction:
Finger of Death
A humanoid killed by this spell rises at the start of your next turn as a zombie that is permanently under your command, following your verbal orders to the best of its ability.
True Polymorph
Choose one creature or nonmagical object that you can see within range. You transform that creature into a different creature ... If you concentrate on this spell for the full duration, the transformation becomes permanent. ... If you turn a creature into another kind of creature, the new form can be any kind you choose whose challenge rating is equal to or less than the target's. The target's game statistics, including mental ability scores, are replaced by the statistics of the new form. It retains its alignment and personality. ...
By now, you probably understand where I'm going with this. You would first start by using Finger of Death to create a normal zombie servant under your control. Next, you would use the True Polymorph spell to transform said zombie into a skeleton (which you can do because they are both challenge rating 1/4). Then you simply wait out the spell's duration, which makes the transformation permanent, and, since a transformed creature "retains its alignment and personality" you now have one permanent skeleton companion at your disposal.
In fact, using this method, you could create a permanent companion out of any creature of 1/4 challenge rating you may desire.
In Summary
Finger of Death + True Polymorph = permanent skeleton companion