Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My difficulty: I connect to a variety of servers through SSH, sometimes more than 7. Currently I have doing this through OSX's Terminal with shell commands, which works pretty good, except for the fact that I gotta remember the address, username and port everytime I connect and often I'm typing the full command (because it's too far back in the bash history).

So, I'm wondering if there is a program or script that just runs commands in Terminal that can store the connection information, just to make life a little easier.

share|improve this question
up vote 3 down vote accepted

You can do this by setting per-host defaults in your $HOME/.ssh/config file. Here's the man page the covers the different options that you can set.

Also, for servers on a local network where you have more control over security, you can use key based authentication (no password required). To do this, you have to generate a client ssh key, and place it on the server. Here's some instructions for Ubuntu which should work for OS X as well HOWTO: SSH & Public Keys

share|improve this answer
I added some entries in my ssh config file, and its great. ssh ip or ssh dns, and the user, port, and such come from the config file. You just need to remember the password for the computer. – Clinton Blackmore Aug 21 '09 at 1:18
Ah, good point about the password I could mention certificate auth. – Dana the Sane Aug 21 '09 at 1:23

to search through commands faster try ctrl+r then enter the name/ip of the host and you'll get straight to the command.

Another way is to set aliases using ssh config (~/.ssh/config/) file like this: Host alias HostName User username

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.