I did this when I was 4 years into my engineering career. After 20 years I ended up a CTO at a large (~40bn) company. There are good things about it, but I am still the happiest when I have time to code and build stuff. Managing others is nearly entirely about emotional intelligence, empathy, and it's better to be an extrovert as your days will mostly be all meetings. Money is fine, but I am not sure I'd do it again if I were to start from scratch. With all the hindsight I think I'd advise myself to join a startup instead.
In any case, don't neglect the company culture. If you want to learn management, don't do it in places with zero strategy and short term focus - you will only learn to never attempt it again, most likely.