• Blog
  • Docs
  • Careers
  • Get Support
  • Contact Sales
DigitalOcean
  • Browse all products

    Featured AI Products

    Managed Agents

    Run AI agents in the cloud with governed tool access

    New

    Learning Services

    Improve agents and models with evidence

    New

    Data Services

    Store, retrieve, and surface the context you need

    Inference Engine

    Run inference at scale with policy-driven routing

    Model Library

    Discover, compare, and evaluate AI models

    GPU Droplets

    GPU-powered virtual machines to build and run AI apps

    Browse all products
  • See all solutions

    AI/ML

    AI HR Knowledge Assistant

    Deploy AI tools developed for Human Resources

    AI Training GPU

    Accelerate model training with dedicated GPU infrastructure

    AI Recommendation Engine

    Build tools to personalize user experiences

    Multimodal AI

    Run models that process multiple data types

    GPU Clusters

    GPUs clustered together for large-scale tasks

    GPU Inference

    Serve models efficiently with optimized GPU compute

  • Community

    Blog

    The latest product releases and insights from our experts

    The Wave

    Content to level up your business

    Tutorials

    Our extensive library of technical articles

    Q&A

    Answers to your cloud and coding questions

    YouTube

    Educational content and tutorials

    Visit DigitalOcean's Community Site
  • Become a Partner

    About Partner Pod

    Discounts, revenue share, and more for businesses

    AI Partner Program

    Boost your AI business

    DigitalOcean Startups

    Resources and support to propel your startup

    Partners Directory

    Current list of DigitalOcean Partners

    Customer Stories

    Customers growing on DigitalOcean

    Need help? Talk to an expert
    Become a Partner
  • Pricing
  • Log in
  • Sign up
  • Log in
  • Sign up

Company

AboutLeadershipBlogCareersCustomersPartnersReferral ProgramAffiliate ProgramPressLegalPrivacy PolicySecurityBrandInvestor Relations

Products

Managed AgentsKnowledge BasesGPU DropletsBare Metal GPUsInference EngineData ServicesLearning ServicesInsightsEvaluationsModel LibraryMicroVMsDropletsKubernetesFunctionsApp PlatformLoad BalancersManaged DatabasesSpacesBlock StorageNetwork File StorageAPIUptimeSecrets ManagerCloud Security Posture Management (CSPM)Identity and Access Management (IAM)CloudwaysView all Products

Resources

Community TutorialsCommunity Q&AWrite for DOnationsCurrents ResearchDigitalOcean StartupsWavemakers ProgramCompass CouncilOpen SourceNewsletter SignupMarketplacePricingPricing CalculatorDocumentationRelease NotesCode of ConductShop Swag

Solutions

AI Training GPUGPU InferenceVPS HostingWebsite HostingVPNDocker HostingNode.js HostingWeb Mobile AppsWordPress HostingVirtual MachinesView all Solutions

Contact

SupportSalesReport AbuseSystem StatusShare your ideas
AboutLeadershipBlogCareersCustomersPartnersReferral ProgramAffiliate ProgramPressLegalPrivacy PolicySecurityBrandInvestor Relations
Managed AgentsKnowledge BasesGPU DropletsBare Metal GPUsInference EngineData ServicesLearning ServicesInsightsEvaluationsModel LibraryMicroVMsDropletsKubernetesFunctionsApp PlatformLoad BalancersManaged DatabasesSpacesBlock StorageNetwork File StorageAPIUptimeSecrets ManagerCloud Security Posture Management (CSPM)Identity and Access Management (IAM)CloudwaysView all Products
Community TutorialsCommunity Q&AWrite for DOnationsCurrents ResearchDigitalOcean StartupsWavemakers ProgramCompass CouncilOpen SourceNewsletter SignupMarketplacePricingPricing CalculatorDocumentationRelease NotesCode of ConductShop Swag
AI Training GPUGPU InferenceVPS HostingWebsite HostingVPNDocker HostingNode.js HostingWeb Mobile AppsWordPress HostingVirtual MachinesView all Solutions
SupportSalesReport AbuseSystem StatusShare your ideas

© 2026 DigitalOcean, LLC.

Sitemap
Product updates

Have a lot of Droplets? Use do-ssh-alias for easier SSH access

author

By Kamal Nasser

  • Published: May 7, 2020
  • 3 min read
<- Back to blog home

If you have a lot of Droplets on your account, you probably agree that it’s hard to keep track of all of them—especially if you create new ones and destroy them frequently for one-off workloads. A common pain point is having to look up a Droplet’s IP address when needing to SSH into it.

I created do-ssh-alias to help address that. Let’s look at how it can help.

What is do-ssh-alias?

Let’s assume you have a Droplet named shiny-blog. Usually you would look up its IP address and then SSH into it like so:

ssh username@1.2.3.4

What if, instead, you could simply run the following command?

ssh shiny-blog

This is where do-ssh-alias comes in. It creates SSH aliases for all your Droplets at once so you can easily SSH in, without having to worry about what user or hostname to use.

It is especially useful if your Droplets’ hostnames are FQDNs (e.g. shiny.example.com) that don’t point directly to the Droplets’ IP addresses. One example is using Cloudflare in front of your website, so your domain name resolves to a Cloudflare server instead of your Droplet.

How do I use it?

do-ssh-alias depends on the programs jq and doctl. The first step is installing jq and installing doctl. Linked are the installation instructions for each program. Once you install doctl, log it in to your DigitalOcean account.

With the dependencies taken care of, let’s now install do-ssh-alias. You can either download the script from GitHub or use the command line:

wget https://do.co/do-ssh-alias

It’s always a good idea to review any scripts you download from the internet before executing them.

Once you have the file on your computer, update its permissions to allow it to be executed:

chmod +x do-ssh-alias

It’s now ready to use. To generate aliases for your Droplets, run:

./do-ssh-alias > ~/.ssh/do_aliases

This will run do-ssh-alias and save the results in the file ~/.ssh/do_aliases.

Finally, update your ssh config to actually use the file with the aliases. Open ~/.ssh/config in a text editor and add the following line at the top:

Include do_aliases

That’s it. You can now SSH to your Droplets using their hostnames! Any time you create or remove Droplets, simply run it again to update the configuration.

What else can it do?

do-ssh-alias only generates SSH aliases, but it accepts a few options for some flexibility:

  • -u: Pass your SSH username like -u sammy to automatically use it for all hosts.
  • -i: To ignore certain Droplets and not create aliases for them, pass their hostnames like -i ignored-hostname-1 -i ignored-hostname-2.
  • -s: Pass a suffix with the -s option to generate additional aliases with that suffix stripped. For example, if your Droplet’s hostname is shiny.example.com passing -s .example.com will generate an alias for ssh shiny in addition to ssh shiny.example.com.

Below is an example of using all three options.

Show me an example, please!

Let’s assume you have the following Droplets on your account:

  • droplet1
  • droplet2.domain.com
  • droplet3.domain.com

Running:

do-ssh-alias -u sammy -i droplet1 -s .domain.com

will generate aliases for:

  • ssh droplet2.domain.com
  • ssh droplet2
  • ssh droplet3.domain.com
  • ssh droplet3

all using the username sammy to log in. The SSH config will look like so:

Host droplet2.domain.com droplet2
Hostname Droplet2-IP
User sammy

Host droplet3.domain.com droplet3
Hostname Droplet3-IP
User sammy

Resources

Here are some resources you may find useful:

  • do-ssh-alias on GitHub
  • How To Configure Custom Connection Options for your SSH Client

Note: doctl itself provides similar functionality through the doctl compute ssh command which allows you to SSH into a Droplet using its ID or name. The main difference is that doctl looks up the Droplet’s IP address using the DigitalOcean API every time you run it, while do-ssh-alias generates a static config file that ssh reads. You might prefer do-ssh-alias if:

  • you want an SSH config that can be copied to other computers without having to install doctl or store your API token on them; or
  • want to avoid the added latency of doctl’s API request.

About the author

Kamal Nasser
Kamal Nasser
Author

Share

  • Product Updates

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
Sign up

Related Articles

DigitalOcean Secrets Manager is now generally available: Manage credentials for your agents and applications in one place
Product updates

DigitalOcean Secrets Manager is now generally available: Manage credentials for your agents and applications in one place

Dre Armeda
  • December 4, 2026
  • 8 min read

Read more

DigitalOcean Insights is now generally available: Unified observability across every layer of your stack
Product updates

DigitalOcean Insights is now generally available: Unified observability across every layer of your stack

Shridhar Pandey

  • November 24, 2026
  • 6 min read

Read more

QM, Y Combinator's Open-Source Agent Harness, Now Deploys in One Click on DigitalOcean
Product updates

QM, Y Combinator's Open-Source Agent Harness, Now Deploys in One Click on DigitalOcean

DigitalOcean
  • November 10, 2026
  • 2 min read

Read more