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.

2 Answers 2

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

2
  • 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. Aug 21, 2009 at 1:18
  • Ah, good point about the password I could mention certificate auth. Aug 21, 2009 at 1: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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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