Create SSH Bookmarks in Terminal for Quick Remote Server Access in Mac OS X
Setting up SSH bookmarks within Terminal app is an easy way to quickly connect to remote machines. If you haven’t noticed these in Terminal before it’s probably because they aren’t labeled as bookmarks, and therefore the feature gets frequently overlooked by even the most advanced Mac users. Here’s how to create bookmarks within Terminal, and also two quick ways to access any of those bookmarks from just about anywhere in Mac OS X.
Setting SSH Bookmarks in Terminal
This guide is intended for SSH but it would also work for Telnet:
- Launch Terminal (/Applications/Utilities/ folder)
- Pull down the “Shell” menu and choose “New Remote Connection”
- Choose SSH on the left side, then click the [+] plus icon to add a new server bookmark
- Enter the IP of the server – Important note: if you use a custom port and username enter those in the URL field as the following syntax: “-p port firstname.lastname@example.org”
- Click “OK” and you’ll find the standard command line syntax for connecting to an SSH server is printed in the connection window
- Click “Connect” and away you go, using the custom port and username you specified
For example, if I use port 24 and the username “dude” for server3.osxdaily.com, the syntax would be: “-p 24 email@example.com”
You’ll notice we ignored the “User” field in this example because we set a custom port. If the server you are connecting to uses the default port 22 (like the OS X SSH server does) you won’t need to do this.
2 Ways to Quickly Access Terminal Bookmarks
Now that a bookmark has been created, quickly access the bookmarks from just about anywhere using these two methods:
- From Terminal, hit Command+Shift+K to open the New Connection window
- From anywhere in Mac OS X, right-click on the Terminal Dock icon and choose “New Remote Connection”
Both of these will bring up the connection window where the bookmarks reside. Connecting to a bookmark will request a password unless you have SSH keys set up for passwordless logins.
If you live and breathe in the command line you’ll likely find that making SSH shortcuts with aliases is a faster method to access any frequently used server, however.