Rooting Android for Linux

Is there anyone that can help me manually root an old android phone so I can run Linux on it?

What model phone?

I have an old samsung s6 active and a samsung s9 that I would like to use if it does not require any cables. The port on the s9 is broken.

This should help; find your specific phone and there will normally be a section on rooting. Samsung | XDA Forums