I feel old. I remember when we moved from telnet and rlogin to ssh and this was in the man page. I'm also happy to learn kids are still using terminals and ssh.
Closing a stale SSH connection
41–50 of 91 posts
Re: Closing a stale SSH connection
#42Pretty sure the answer is no, cause I've been searching for a way to do this for a while, but is there any way to trigger these escapes from script? Use case is bouncing through to an RDS that only allows access from specific EC2 instances. The RDS endpoint in question is highly specific to the EC2 - not a big deal to hit ~L and create the forward manually, but doing this automatically would be great.
Re: Closing a stale SSH connection
#43I feel old. I remember when we moved from telnet and rlogin to ssh and this was in the man page. I'm also happy to learn kids are still using terminals and ssh.
I suspect many linux users nowadays don't even know that manpages exist or don't want to use them. Otherwise blogposts like this would not exist.
What users do nowadays is rely on alternatives such as https://tldr.inbrowser.app/
Re: Closing a stale SSH connection
#44One caveat here is the note: > (Note that escapes are only recognized immediately after newline.) This means that it is easy to pick up a habit to smash the enter-button a few times before doing this dance, and as noted on a nordic layout it can be a bit tricky and since you might seldom do it you might do it a few times. Problem can be that sometimes the connection is only broken one way, what you are typing goes to…
Incidentally, while testing on Windows (in both WSL and cmd.exe) with a Finnish layout: you do not need a space after typing out the tilde.
Re: Closing a stale SSH connection
#45Pretty sure the answer is no, cause I've been searching for a way to do this for a while, but is there any way to trigger these escapes from script? Use case is bouncing through to an RDS that only allows access from specific EC2 instances. The RDS endpoint in question is highly specific to the EC2 - not a big deal to hit ~L and create the forward manually, but doing this automatically would be great.
Re: Closing a stale SSH connection
#46One caveat here is the note: > (Note that escapes are only recognized immediately after newline.) This means that it is easy to pick up a habit to smash the enter-button a few times before doing this dance, and as noted on a nordic layout it can be a bit tricky and since you might seldom do it you might do it a few times. Problem can be that sometimes the connection is only broken one way, what you are typing goes to…
Re: Closing a stale SSH connection
#47One caveat here is the note: > (Note that escapes are only recognized immediately after newline.) This means that it is easy to pick up a habit to smash the enter-button a few times before doing this dance, and as noted on a nordic layout it can be a bit tricky and since you might seldom do it you might do it a few times. Problem can be that sometimes the connection is only broken one way, what you are typing goes to…
Another note for nordic layouts and Linux: tilde (~) is considered to be a "dead key" on most nordic layouts, meaning you may need to follow AltGr + ~ with a space before typing out the dot. Otherwise you might get weird looks from the terminal trying to figure what you meant with the tilde-dot. Incidentally, while testing on Windows (in both WSL and cmd.exe) with a Finnish layout: you do not need a space after typin…
Re: Closing a stale SSH connection
#48I feel old. I remember when we moved from telnet and rlogin to ssh and this was in the man page. I'm also happy to learn kids are still using terminals and ssh.
Re: Closing a stale SSH connection
#49Why is this better than CTRL-C?
Otherwise how could you send a control-C without any special guard sequence while ssh-ing?
Re: Closing a stale SSH connection
#50I feel old. I remember when we moved from telnet and rlogin to ssh and this was in the man page. I'm also happy to learn kids are still using terminals and ssh.
Well... terminal emulators. Bonus points to everyone who has an actual VT240 on their physical desktop.
Bonus points to anyone who can find one and get it to work. I want one, but it's a huge investment (both in price and effort)