Results 1 to 3 of 3

Thread: [SOLVED] Store SSH Locations

  1. #1
    Join Date
    Feb 2006
    Beans
    195

    [SOLVED] Store SSH Locations

    If I was in Windows, I would use PuTTY to connect to the necessary servers.
    In Linux, I am using the Gnome Terminal and the ssh command.

    The obvious benefit with PuTTY is that I can store all my frequently used locations by common name and I don't have to remember the IP.
    How can I do this in Linux?

  2. #2
    Join Date
    Mar 2006
    Beans
    1,107

    Re: Store SSH Locations

    you can predefine short nicknames for Ips that you ssh to in /etc/hosts
    IPAddress Hostname Alias
    208.164.186.1 deep.openna.com nickname1
    208.164.186.2 mail.openna.com nickname2
    208.164.186.3 web.openna.com nickname3

    $ ssh nickname


    or do something like this
    http://articles.techrepublic.com.com...tag=rbxccnbtr1

    or if you are at your house, you may be able to define host names for Local Ips for the LAN. I do this by re-flashing my router with something like Tomato or DD-WRT
    Last edited by cantormath; October 25th, 2008 at 05:59 PM.
    Linux Hardware Boycott!
    How Many People Have you Converted To Linux?
    HD-DVD code:I cant tell you because I got an infraction for posting it here.

  3. #3
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Store SSH Locations

    You can create simple aliases to use in the terminal, to automatically connect to the destination.

    First, enable aliases by editing ~/.bashrc and find these lines:
    Code:
    #if [ -f ~/.bash_aliases ]; then
    #    . ~/.bash_aliases
    #fi
    Uncomment them, and save it. Now create a new file called .bash_aliases in your $HOME directory, and this is where we will store our aliases. Here is a few examples of aliases you can make, which should help get you started:
    Code:
    alias mycroft="ssh 192.168.0.70"
    alias maymith="ssh 192.168.0.101"
    alias :q="exit"
    Now, either logout, or run:
    Code:
    . .bashrc
    And your aliases will be loaded. Now you can run your alias in the terminal, just by running:
    Code:
    mycroft
    And it will actually be running:
    Code:
    ssh 192.168.0.70
    But you won't have to type it
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •