How I Manage SSH Connections with Terminal for Mac
I've recently switched to using a Mac as my main workstation at work and there's definitely been a learning curve. On my Windows box (which I still have for running RSAT tools and local Hyper-V VMs), I had an SSH & SFTP client with my frequent connections already configured. I've been trying to replicate this, so I've written some info on managing SSH connections, SSH Keys and configuring "profiles" of sorts for boxes that I access commonly.
An Easy Way
Create a simple text file called config and put it in your .ssh directory. Put entries in it for the servers you want to access. I've included some sample entries below.
Host serv1
Hostname server1.domain.com
User user
If you're running SSH on a non-standard port, you can include the port info.
Host serv1
Hostname server1.domain.com
User user
Port 2222
If you're using a private key file to access a server, you can include that as well.
Host serv1
Hostname server1.domain.com
User user
IdentityFile ~/.ssh/id_rsa
Personally, I like to make a directory in my .ssh dir to keep my private keys and give them unique names so I know what sites they're for.
Comments
Post a Comment