Live data from Hacker News

SSH Secret Menu

twitter.com

31–40 of 184 posts

Re: SSH Secret Menu

#31
post #9

Earlier quoted context omitted.

Note that it only works after pressing enter, so the odds are slim. In practice, I don't think I ever hit it by accident.

I have noticed it while running ~/bin/some_command. The ~ doesn't echo until I also type the /. It doesn't cause any misbehavior because there is no binding for ~/ but can be slightly surprising.

I find it odd that you would have commands in ~/bin but not have it be the highest priority in your PATH. I use ~/.local/bin, but would never type it because i wouldn't have bins that overlap shell commands and no other path would have priority.

Re: SSH Secret Menu

#32
post #5

That doesn't do much good if you set `EscapeChar` to `none` in `.ssh/config`. I find it convenient not to have to worry about accidentally entering escape characters. YMMV.

SSH does it pretty well though. Never once have I done it by mistake.

I'd guess this is because it only works in ssh PTY sessions. So it would have no effect on tunneling or when piping arbitrary data through ssh to a non-interactive remote command (unless you use the -t switch to force PTY allocation even when stdin is not a TTY).

Re: SSH Secret Menu

#33

Earlier quoted context omitted.

SSH does it pretty well though. Never once have I done it by mistake.

I'd guess this is because it only works in ssh PTY sessions. So it would have no effect on tunneling or when piping arbitrary data through ssh to a non-interactive remote command (unless you use the -t switch to force PTY allocation even when stdin is not a TTY).

No I don't think so. I mainly and pretty much constantly use SSH for logging in. I'm not one of those 'cattle not pets' guys lol.

And when I port forward I usually don't even tunnel it over SSH because all my stuff is on tailscale so it's also encrypted.

Re: SSH Secret Menu

#34
Secret Menu -> Escape Characters

I really hate it when people just rename terms. It made it harder to search properly for better answers.

Re: SSH Secret Menu

#36
post #11

I've been using SSH for ~15 years and never knew about these escape sequences. I'm eagerly awaiting my next hung session so that I can test `~.`. It's much nicer than my current approach of having to close that terminal window.

Have been using that weekly since probably 20 years. Will change your life :) My other favourite is I very often SSH with -v to figure out why the connection is hanging, you rapidly figure out if DNS is failing, the TCP connection doesn't open, it does open but no traffic flows at all or it opens and SSH negotiation starts but never finishes. You can learn a lot just from this about what is wrong.

Also helps with auth failures, I've used it several times with co-workers who can't figure out why their ssh key isn't working. It lists the keys out and some extra information.

Re: SSH Secret Menu

#37

I've been using SSH for ~15 years and never knew about these escape sequences. I'm eagerly awaiting my next hung session so that I can test `~.`. It's much nicer than my current approach of having to close that terminal window.

Just ssh to funky.nondeterministic.computer to test it out!

Re: SSH Secret Menu

#38
post #26

I've used ~. for a long time but did not know about others. I know, should have read man page. Anyway, if you try it from shell prompt it is likely will not work as pressing ENTER shows the next prompt. Try `cat` followed by ENTER and then ~?

It'll still work. OpenSSH doesn't care about output (for ~ stuff), only input, so if you type ~. it will close the connection.

It does not. open ssh linux to mac, typing ~ just types it on fish shell prompt. It works after`cat` followed by ENTER

Re: SSH Secret Menu

#39
post #35

Those aren’t “secret”, they’re obviously borrowed from rsh — oh that’s right, I’m old.

And these days you need to pass "-O" to scp to have it behave like rcp.

Re: SSH Secret Menu

#40
post #20

Hidden or undocumented features like this always have a strange appeal. Part of it is nostalgia for older software where small Easter eggs or experimental features would sometimes ship in production builds.

It's not hidden or undocumented; it's in the man page.

Here's 15-year old HN link about it: http://grack.com/blog/2011/02/23/ssh-escape-sequences-or-don...

Post reply on HN