Single user mode (commonly known as save the world mode)
Long press shift to enter grub menu or select Ubuntu advanced mode in startup selection screen, then press e to enter editing mode and change ro recovery nomodeset to RW single init = / bin / bash(note that the changed mode will be activated when it is activated in a short time.).
Press Ctrl + X or F10 to enter single user mode. The current user is root. At this time, you can modify the file. After modification, restart.
The above solution to the problem of Linux server unable to log in is all the content that Xiaobian shared with you. I hope you can give us a reference and support developepaer.