How to access my server if login need 2FA?

Hi, How to access my linux server if login to server needs 2FA?

Can’t say anything specific without any details given (2FA is a general term, there are infinite specific ways to implement it).
You basically need to find a programmatic way to do what you want – then add it into your build logic.