Linux Format

SSHidden gems

-

SSH client feels like a simple beast. You invoke it, you pass it the hostname… and that’s it. At most, you supply -L command-line switch for TCP connection forwarding, or -X for X11 forwarding, and earn some brownie points. Sure, the man page lists a few other options, but why should you care?

Recall the last time you spun off the ssh just to remember you forgot to add -L . You can just terminate the session and respawn it again. However, ssh provides a better way: the menu. Just type Enter then ~ during your interactiv­e session. Nothing would change visually, but the next key you type will have a special effect.

For an overview, press ? You’ll see that the dot terminates current session which comes handy when it becomes unresponsi­ve and Ctrl-C doesn’t help. Note that you’ll need to type all three keys: Enter, ~, and .. V increases verbosity, # lists forwarded connection­s. But perhaps most importantl­y, C opens the command line. Type help to list available commands. From here, you can create and terminate port forwarding­s, including dynamic ones. The latter effectivel­y creates a SOCKS proxy which works over the SSH channel. The only inconvenie­nce is that help command closes the menu, so you need to type Enter, ~ and C to start over.

Isn’t it amazing how many tricks are stuffed into a small executable ssh ?

Newspapers in English

Newspapers from Australia