Streamlining SSH Connections: A Quick Guide

Apr 8, 2023·
Derek Armstrong - Staff Software Engineer and Solutions Architect
Derek Armstrong
· 2 min read

Maximizing efficiency in our daily tasks is a shared goal among developers. When it comes to SSH connections, wouldn’t it be great to reduce this…

ssh user_name@Server1.domain.com -i /path/to/your/keyfile

…to simply this?

ssh Server1

Today, I’m sharing a quick guide on how to set default values for host, user, and key file in your SSH connections.

Pro Tip: You can use these in VSCode or your favorite JetBrains IDE too!

Configuring the SSH Config File

The default path to the SSH config file is ~/.ssh/config. Let’s explore how to set it up:

# Set Default User for All Hosts
Host *
  User your_user

# Set Default User, HostName, and Key File
# You don't have to use a keyfile aka SSH Key, just comment it out
Host name-to-use # Name you want to use - ssh Host
  HostName 10.10.10.10 # The IP address or FQDN of the destination server
  # HostName servername.domain.com
  IdentityFile /path/to/your/key/KeyFile.pem # Key File
  User your_user # Default User

By implementing these configurations, you can make your SSH connections more efficient and easier to manage. This approach is especially useful when you’re frequently connecting to the same servers or clusters.

Remember, efficiency is key in any development environment. I hope this guide proves useful in your daily tasks. Do you have more tips to streamline SSH connections? Feel free to share in the comments!

Key Takeaways

  • An SSH config file at ~/.ssh/config lets you define aliases, default users, and key paths so you can connect with ssh Server1 instead of typing full hostnames and key paths every time
  • Setting a wildcard Host * block establishes defaults for all connections, reducing repetition when you frequently use the same user or key
  • The config works with VSCode Remote-SSH and JetBrains IDEs — whatever tool you use to connect, it reads the same config file

Next

Derek Armstrong - Staff Software Engineer and Solutions Architect
Authors
Staff Software Engineer | Solutions Architect
Staff Software Engineer, AI Systems Engineer, and Solutions Architect with 10+ years of experience designing and shipping production systems at enterprise scale. I lead teams building payment platforms processing billions in annual volume, architect cloud-native infrastructure, and integrate AI/ML capabilities into mission-critical systems. Passionate about turning complex technical challenges into reliable, scalable solutions — and about mentoring the engineers who will carry that work forward.