1

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.

Darryl Hein
  • 1,712
  • 2
  • 19
  • 21

2 Answers2

3

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

Dana the Sane
  • 828
  • 10
  • 19
  • 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 01:18
  • Ah, good point about the password I could mention certificate auth. – Dana the Sane Aug 21 '09 at 01:23
1

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 ydoain.com User username

kargig
  • 314
  • 1
  • 2