I couldn't find the link I wanted, but here's a conceptual start:

function ssh_new {
        arglist=''
        for i in $@; do
                arglist="$arglist $(echo $i | sed -f ~/.hosts)"
        done
        /usr/bin/ssh $arglist
}

And then ~/.hosts looks like this (just sed commands):

s/mygateway/192.168.0.1/
s/myserver/192.168.0.5/


On Mon, Apr 20, 2009 at 8:57 AM, Daniel Eggleston <[email protected]> wrote:
> you can alias ssh to a bash function that looks up hosts from a home
> directory file -- I'll find a link to something about this and send it
> along.
>
> On Mon, Apr 20, 2009 at 8:13 AM, ravi <[email protected]> wrote:
>>
>> Hi,
>> I want ssh to read entries for hostname resolution from my home
>> directory instead of /etc/hosts.
>> Is it possible to do this?
>>
>>
>> >>
>>
>
>
>
> --
>
>           Daniel
>



-- 

           Daniel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to