Occasionally when I SSH or Telnet into a remote server (using Putty) I fat-finger my username and don't realize it until after I hit ENTER.
The subsequent 'password' prompt of course never works because there's no user with that username. I would imagine that enough 'wrong' passwords would trigger a security lockout of my IP address – so I disconnect and reconnect and more carefully enter my details.
Is there a way to abort the login and get back to the 'username' prompt without disconnecting (Control-C) from the remote server and reconnecting?
Best Answer
Not with SSH. With SSH the username is sent as part of the initial connection handshake and there's not really an
Username:
login prompt running on the server side that you could go back to.The
Username:
prompt you might be seeing is generated by the PuTTY client itself, before it even establishes the SSH connection.Don't use Telnet! If you do, you should assume everyone now knows your password. It's a terribly insecure protocol. It's 2019, there's really no reason not to use SSH these days.
Then look into storing the username as part of the connection information.
Looks like in PuTTY you can do so under
Connection > Data > Login details > Auto-login username
.You can either create specific sessions for the servers you typically log in to (in which case you won't need to type the server's hostname either), or you can save that as part of your default session, if you typically use the same username in all servers you connect to (just go back to sessions and save your changes to the default session to make that the default for you.)