Use stty to set the terminal parameters.
If you don’t know how to set it up, just find a server with no problem, show the parameters, and you will know the difference by comparing the two servers.
Many people didn’t get the point. The presence of these characters indicates that there is nothing wrong with the terminal , but the program that accepts the keystrokes, the shell, does not understand the arrow keys correctly. Detect whether the shell is bash or zsh? If it is dash, the edit key is not supported. You can type bash and hit enter to see if that improves.
Change the character encoding of the local ssh tool, or change the ssh configuration file and change the character set. Or there is a cursor mode in the tool, just select it
@DonnieGo It works normally when I type bash. I took a look at the file in /etc/passwd and found that the shell field is empty. I think this is the reason.
Use stty to set the terminal parameters.
If you don’t know how to set it up, just find a server with no problem, show the parameters, and you will know the difference by comparing the two servers.
Many people didn’t get the point. The presence of these characters indicates that there is nothing wrong with the terminal , but the program that accepts the keystrokes, the shell, does not understand the arrow keys correctly. Detect whether the shell is bash or zsh? If it is dash, the edit key is not supported. You can type bash and hit enter to see if that improves.
Usually knows what shell it is.Use
Shift key + Delete key
Can be deleted and used temporarily
Change the character encoding of the local ssh tool, or change the ssh configuration file and change the character set. Or there is a cursor mode in the tool, just select it
Type bash and press Enter, try again?
Same request, I was so stupid when editing, so sad
@DonnieGo
It works normally when I type bash. I took a look at the file in /etc/passwd and found that the shell field is empty. I think this is the reason.
@DonnieGo said: type bash and press enter
Solved!
To summarize the method once and for all:
Enter chsh
Enter /bin/bash after Login Shell [*]
Every connection will be ok in the future