Open HenrikBengtsson opened 1 year ago
Did you notice a tilde in an account name? I don't think it should be allowed by the form?
Did you notice a tilde in an account name? I don't think it should be allowed by the form?
Sorry for not being clear. I'm talking about passwords here. Both the random temporary ones and the ones set by the user themselves. I'm concerned about the following:
[log1]: ssh alice@dev1
alice@dev1's password:
If the password for alice
starts with a tilde (~
), then typing tilde at this SSH password prompt will be interpreted by original/initial SSH as its special escape character, and put the terminal into a different, invisible mode where the keypresses are no longer interpreted as a password but a control sequences for SSH.
I've just verified that this is the case; For example, if you type ~ and ., the SSH connection (all the way back) is terminated, e.g.
[alice@log1 ~]$ ssh alice@dev1
alice@dev1's password: Connection to log1.wynton.ucsf.edu closed.
[ab@local ~] $
Another example is, if you type ~ and ? at the SSH prompt, you'll get:
[alice@log1 ~]$ ssh alice@dev1
alice@dev1's password:
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - request rekey
~V/v - decrease/increase verbosity (LogLevel)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)
where SSH is now again listening for password entry.
So, having a password starting with tilde (~
) wreaks havoc unless you really know what you're doing, i.e. you'll have to type tilde twice for that first tilde in your password.
Maybe we should recommend against passwords starting with a tilde (
~
). Tilde (~
) is the default escape character in SSH and triggered when entered immediately after a newline. So, if a user SSH in and then enters their password starting with a tilde, they might be entering a world of pain ...This should be verified to be a real problem before making this recommendation. It could be that the escape character is not triggered at the SSH password prompt. OTH, it could be that it is trigger when one SSH from login to development node.
Details: