[ale] Using ~/.ssh/config Better?

chip chip.gwyn at gmail.com
Fri Apr 22 09:22:42 EDT 2011


On Fri, Apr 22, 2011 at 9:13 AM, JD <jdp at algoloma.com> wrote:
> At the meeting last night a few of us were talking about the use of the
> ~/.ssh/config file to make remote ssh-based connections easier.  I use
> these all the time, especially to simplify use of non-standard ports or
> different userids across different machines. With the config file,
> there's no need to specify the alternate userid or port for any of those
> tools. Here's an example stanza:
>
> # start file ==================
> host h2
>  user pete
>  hostname home-place.dyndns.org
>  port 42080
> # end file ---------------------
>
> To connect to "ssh -p 42080 pete at home-place.dyndns.org", it is just
>
> $ ssh h2
>
> That's it.
>
> That got me wondering. Besides using key-based authentication with this
> file, are there other uses or tricks that I could be using with this
> file to further simplify ssh, sftp, scp, rsync, rdiff-backup and other
> ssh-based connections?
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>


I make frequent use of the ProxyCommand and X11/Agent Forwarding:

 Host *.pop1
        ForwardAgent yes
        ForwardX11 yes
        User chip
        ProxyCommand ssh 10.125.35.10 /usr/local/bin/connect %h %p

The 10.125.35.10 is sort of a gateway/bastion box.  So on my desktop,
anytime I ssh to a host that ends with pop1 it automatically forwards
my connection through the 10.125.35.10 box.

-- 
Just my $.02, your mileage may vary,  batteries not included, etc....



More information about the Ale mailing list