It sucks to open Terminal each time and write a complete ssh command.
I also have a custom port to connect to.
|
|
|
The most *NIX-y answer is to use SSH's features to your advantage. Create a file named
If you use key-based authentication and store your key's password in the Keychain, you won't even need to enter a password. In addition, you can create a .command file (a plain text file with the extension .command) containing the command line you use to connect to the server ( You can also use the |
|||
|
|
You have a couple options that I can think of: Create a .command fileIn your favourite text editor create save a plain text file with your ssh command, eg.
Name the file Create aliases for your shellAssuming you're using bash (the default shell in Mac OS X) you can add aliases to your eg. You can find more about aliases at Wikipedia or by reading the documentation. |
|||
|
|
|
There are many ways to do this. Here is what I do: Open Terminal Preferences Duplicate your profile on the Settings tab with the gear icon. This changes your default setting file, so change your old default back to what it was before the duplication. In your new custom settings click on Shell type in your ssh command in the Run Command at Startup section. Rename your new setting from Custom to whatever you want. You can now start your session from the New Window or New Tab menu items, and of course a keyboard shortcut can be assigned in Keyboard & Mouse in System Preferences. |
|||
|
|
|
You can create an AppleScript that will run a command for you:
|
|||
|
|
|
If you want a file you can open to launch a session, you can make an .inetloc easily. In TextEdit type an SSH URL to your host, e.g.:
TextEdit will recognize that as a URL. Drag the URL to your desktop and it will create an .inetloc as so:
You can then place that file anywhere, like your Dock, or open it with a launcher such as Quicksilver. I would have recommended the SSH Plugin for Quicksilver, but the latest I can find, v.84, crashes QS newer than β54 (3815). |
|||||
|
|
|
If you are using Quicksilver, there is a great add-on called RemoteHosts which will automatically scan a ~/.hosts file or even your ~/.ssh/known_hosts file to autopopulate. Connecting to a new host is as quick as opening Quicksilver (CMD-Space) and then typing in enough characters of the host to be unique, and finally pressing enter. |
|||
|
|
|
If the part that sucks for you is typing in a long and complex ssh command, but you don't mind opening Terminal, and for some reason you don't want to use any of the previous answers' approaches, then you can also use aliases or functions. Add something like this to shell dotfile (.profile or .bash_profile or .bashrc or .cshrc or .zshrc or whatever):
The only advantage I can see over other approaches is that (in zsh at least, and I think bash) you can use command completion to see all your servers to connect to. For instance, let's say you have 25 different servers you connect to, and you don't want to remember all the names/aliases you gave them in the .ssh/config file. If all of the aliases start with the same thing, like 'connect.', then you just type connect.[TAB] at the command prompt, and you'll see all the possible completions. (Disclaimer: you might need to do some shell customization to get that working, but I believe it will work by default in zsh and probably in bash as well.) If the part that sucks for you is opening Terminal, then you could try using something like DuckBill, although the only reasons I can think of to run ssh OUTSIDE of Terminal might possibly be for running X Windows server programs or an ssh tunnel. |
||||
|
|