Skip to content

Instantly share code, notes, and snippets.

@adityak714
Created April 15, 2025 17:21
Show Gist options
  • Save adityak714/2997bde63f7d6a599097d0279fe946be to your computer and use it in GitHub Desktop.
Save adityak714/2997bde63f7d6a599097d0279fe946be to your computer and use it in GitHub Desktop.
Quickly SSH into servers for frequent sign-ins
Host my-vm
HostName 129.9.9.9.9 # replace with the IP of your server, or the address
User ubuntu # the user to sign in to
IdentityFile ~/.ssh/my-vm.key # if a key is needed to authenticate
# Make replicas of the above block if more VMs to configure
# The file should be named as "config" (just that), and stored in ~/.ssh/ directory.
# Learned from: https://linuxize.com/post/using-the-ssh-config-file/
@adityak714
Copy link
Author

This helped me sign-in quickly to VMs that I needed to access several times, without having to remember their exact addresses, and writing the long command ssh -i ~/.ssh/my-key.key ubuntu@129.... everytime. Hope this helps others also!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment