ssh destination alias? - SSH

This is a discussion on ssh destination alias? - SSH ; I have a remote machine that I can get to via an ssh tunnel. To get there I have to type ssh localhost -p 9154 I would like to just type something like ssh apple .. I vaguely recall a ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: ssh destination alias?

  1. ssh destination alias?

    I have a remote machine that I can get to via an ssh tunnel. To get there I
    have to type
    ssh localhost -p 9154

    I would like to just type something like
    ssh apple
    .. I vaguely recall a post where someone said that using some file this type
    of thing was possible (Ie associateing "apple" with "localhost -p 9154")

    Could someone point me to the right info again. Sorry I did not save that
    last post. (I have no idea where I read it, what newsgroup, etc)


  2. Re: ssh destination alias?

    On Fri, 05 Sep 2008 01:46:20 GMT, Bill Unruh wrote:
    > I have a remote machine that I can get to via an ssh tunnel. To get there I
    > have to type
    > ssh localhost -p 9154
    >
    > I would like to just type something like
    > ssh apple
    > . I vaguely recall a post where someone said that using some file this type
    > of thing was possible (Ie associateing "apple" with "localhost -p 9154")


    click up a terminal, cut/paste for testing

    Test one:

    alias ssh_apple='ssh localhost -p 9154'
    ssh_apple

    Test two:

    alias apple='localhost -p 9154'
    ssh $apple


  3. Re: ssh destination alias?

    On Fri, 05 Sep 2008 01:46:20 +0000, Bill Unruh wrote:

    > I have a remote machine that I can get to via an ssh tunnel. To get
    > there I have to type
    > ssh localhost -p 9154
    >
    > I would like to just type something like ssh apple
    > . I vaguely recall a post where someone said that using some file this
    > type of thing was possible (Ie associateing "apple" with "localhost -p
    > 9154")
    >
    > Could someone point me to the right info again. Sorry I did not save
    > that last post. (I have no idea where I read it, what newsgroup, etc)


    Using OpenSSH, you can create a file called config in your .ssh
    directory containing the following:

    Host apple
    HostName localhost
    HostKeyAlias apple
    User
    Port 9514

    With this, ssh apple will do the right thing.




+ Reply to Thread