Miscellaneous SSH notes

Passwordless SSH

You really want to have passwordless ssh set up.

Quitting hung session

Firstly you haven’t pressed ctrl-s have you? Try pressing ctrl-q

If all else fails type “[Enter] ~.” with the full stop. More pleasant than killing your whole terminal. If you were running your session within screen/tmux you might be able to recover it.

Socks proxies

I have recently (March 2006) found out about socks proxies with ssh. Here are my rough notes on that. First do:

ssh -D 1080 remote.host.name

Then you can access the internet through the socks proxy running on localhost:1080 and anyone you connect to will think you are coming from the computer you are ssh’d into.

You can try to get arbitrary programs to use the socks proxy with tsocks or proxychains. For various technical reasons this will not work with all programs. But many should work fine.

If you just want this for web browsing it is probably easier to configure your browser to use localhost port 1080 as your SOCKS 5 proxy. If you need to access internal sites with hostnames that do not resolve elsewhere on the internet you will also need to configure your browser to use SOCKS for DNS. In firefox set the proxy in (Edit|Preferences|General|Connection Settings). Then type about:config<ENTER> in the location bar and turn on the network.proxy.socks_remote_dns option. Now all your web browsing (including https://) will go via the remote host.

If you do this sort of tunneling a lot and need to quickly toggle proxy settings then you could use an extension like FoxyProxy.