You searched for articles tagged with SSH.

Secure HTTP Tunnel Permalink

Linux, Shell, Privacy, SSH Added less than a year ago and last edited less than a year ago

The Stupid Way

(Don't do this, see The Smart Way below)

On a remote machine that you have SSH access to:

remote$ hostname
host.where.proxy.is.running
remote$ # start an HTTP proxy running on port 8887 here

Then, on your local machine:

local$ ssh -qnN -L 8080:localhost:8887 host.where.proxy.is.running.tld &

... and setup your browser to use localhost:8080 as the proxy.

The proxy software I use on my remote host is TinyProxy

The Smart Way

You don't even need to setup a proxy at your remote host if you just create a tunnel like this:

local$ ssh -qnN -D 1080 remotehost &

... that will setup a tunnel from on your local machine from localhost:1080 over to remote, and then use the remote server to just send any requests you make through there... like a relay. So if you set your browser to use the SOCKS proxy on localhost:1080 then you have a tunnel without having to setup any proxy software. Thanks Snare!




SSH Config Permalink

Linux, Shell, SSH Added less than a year ago and last edited about a month ago

Users

If you are on a system as user fredb and you want to ssh to a host where your login is superman, you would normally have to specify the username on the ssh line like so:

fredb@thishost$ ssh superman@otherhost

... but you can save yourself some typing by specifying that a ssh to otherhost should try to login as superman every time by adding some lines to your ~/.ssh/config file:

Host otherhost
    User superman

Now you can simply do this:

fredb@thishost$ ssh otherhost

... and it will ask for superman's password instead of fredb's.

Host Nicknames

You can also use your config file to specify host nicknames. Say you normally connect to longhostname.tld, you can shorten that to lhn if you like:

Host lhn
    Hostname longhostname.tld
    User jsmith

... now you simply:

$ ssh lhn

Identity Files (Keys)

If you have keys set up for your various hosts, and those keys are loaded in your ssh-agent, you might like to specify which key belongs to which host in the config file.

Host lhn
    Hostname longhostname.tld
    User jsmith
    IdentityFile ~/.ssh/id_dsa.longhostname

This is important if you have greater than 6 keys in your agent. Why? Because without this mapping, ssh-agent will iterate through its list of keys until it finds one that works - but the host will hang up after 6 unsuccessful tries! If your key is number seven in the list then it will not work. So, adding the IdentityFile mapping in the config file as above will make ssh-agent try the correct key the very first time.




(Nothing Older) ... (Nothing Newer)

Colophon

Django Python 960.gs Git Vim NetBSD Nginx

The Author

The author is a software engineer living in Australia. He sux at guitar, loves camping, doesn't like cake, does like coffee and is a lazy home brewer.

Meta

Help
Latest entries

*BSD Agile Apache Apple Athletics Beer Best-Practice Censorship Comedy Cool Crosswords Deployment Django English Exim Firefox Git Hardcore Health Interface irssi Javascript Jira Languages Linux Makefile Markdown Mathematics Mobile Broadband MySQL NetBSD nginx Nokia OSX Perl Photo Privacy Python Rant Requirements rsync Ruby Shell Slackware SQL SQLite SSH Standards Subversion Testing ThisBlog Vim VMWare (Fusion) VPN WDTEM X Yum zsh

Recent Entries

Perldoc Output
Yum
Possum
Git's Index
Jira Project Keys
The Coffee Shop
Git GUI
It is more important...
Questioning Unix (and Other) File Times
The Frog King Photo
Rain Cloud Photo
rsync
Timezone
utf8 in your Perl
Theatre Ceiling Photo
Some problems are so complex...
Colours in your PAGER
zsh vared
zsh magic-equals and double-star
Funny Tweets

Links

ChoppingBoard, Project365, RageQuit

♥ Actors/Artists/Characters