Techxplus

Menu
  • Apple +
    • MAC
  • Gadgets +
  • How-To
  • Tech Tips
  • Wordpress +
Home
Gadgets +
How to create an alias for ssh clients on Mac
Gadgets +

How to create an alias for ssh clients on Mac

Subhro October 3, 2019

If you are using SSH to login into many servers, it can be difficult to remember all the different usernames, hostnames, and IP addresses. I am going to show you how easy it is created to create command-line shortcuts also called as aliases to solve this problem. There are two methods to create an alias.

Method 1. By using ssh config

The first step is to navigate to your .ssh folder

 cd ~/.ssh

Following this, you’ll need to create a file called config. Enter the below command.

 sudo nano config

In this file, you can now create your own shortcuts by specifying the hostname and username. Below is an example of the file structure.

ssh config

Now, you will be able to login by typing ssh <username> in the terminal without entering the password.

Method 2. Create an alias in shell

You can use this method to create an alias for your shell (or terminal). A lot of people use this method to create SSH shortcuts. The first step to navigate to your .bash_aliases file. The following command will create the .bash_aliases file if it doesn’t exist or just edit it if it already does use nano or vim.

 sudo nano ~/.bash_aliases

In this file, you can add as many shortcuts as you want.

alias

Now, run the below command to load the alias.

 source ~/.bash_aliases

To view, your aliases run the alias command in your terminal and all your aliases will be listed.

Now, you will be able to login by entering the username in the terminal.

TIP: To store the alias permanently add the alias in the .bash_profile file.

I hope, you find this useful. Please let me know your views on this.

Share
Tweet
Email
Prev Article
Next Article

Related Articles

best iphone apps
With over more than 2 million apps available in the …

16 best iPhone apps you must try

Homebrew
What is homebrew? Homebrew is a package manager for MAC …

Homebrew for MAC: The complete guide

About The Author

Subhro

Leave a Reply

Cancel reply

Recent Posts

  • How to paste without formatting in MAC?
  • How to create free business email and forward to your Gmail?
  • Change WordPress admin email
  • Remove Bitnami Banner from WordPress on Google Cloud.
  • Homebrew for MAC: The complete guide

Recent Comments

  • Marcelo Miguel Bazan on Change WordPress admin email
  • Marcelo Miguel Bazan on Change WordPress admin email
  • Marcelo Miguel Bazan on Change WordPress admin email
  • SONGSTER2998 on Change WordPress admin email
  • porno on Homebrew for MAC: The complete guide

Archives

  • October 2020
  • April 2020
  • February 2020
  • December 2019
  • October 2019
  • September 2019
  • August 2019

Categories

  • Apple +
  • Gadgets +
  • How-To
  • MAC
  • Tech Tips
  • Wordpress +

Techxplus

Categories

  • Apple +
  • Gadgets +
  • How-To
  • MAC
  • Tech Tips
  • Wordpress +

Featured Posts

paste without formatting mac
free business email
admin email wordpress

LINKS

  • About Us
  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Terms and conditions
  • Contact
Copyright © 2021 Techxplus

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Cookie settingsACCEPT
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.

SAVE & ACCEPT