It sucks to open Terminal each time and write a complete SSH command. How can I create an SSH connection Terminal shortcut on Mac OS X 10.6.8 (Snow Leopard)?
I also have a custom port to connect to.
macosshortcutssshterminal
It sucks to open Terminal each time and write a complete SSH command. How can I create an SSH connection Terminal shortcut on Mac OS X 10.6.8 (Snow Leopard)?
I also have a custom port to connect to.
Best Answer
The most *NIX-y answer is to use SSH's features to your advantage.
Create a file named
config
in~/.ssh/
(a folder named.ssh
in your home folder). Add an entry for each computer you want to connect to, like this:HostName
can be either an IP address or an actual hostname.Port
is not mandatory if using default SSH portIdentityFile
is not mandatory if not using a key.Then, to connect, just type
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 (
ssh compy
orssh -i ~/.ssh/my_rsa_key -p 90 sidney@98.256.211.12
). It will open in Terminal and run that command.You can also use the
New Remote Connection…
menu item in Terminal to connect. Just add your host under SSH by clicking the + button in the right column.Read more HERE