Techxplus

Menu
  • Apple +
    • MAC
  • Gadgets +
  • Google +
  • How-To
  • Reviews +
  • Seo
  • Tech Tips
  • Web Tools +
  • 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.
pi40raspberrypi3A7E2019 08 0400 28 13 1

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

Automator in mac
Automator is a workflow creation tool that features an easy-to-use …

How To use Automator to save time In Mac By Doing Less

terminal mac
The macOS default Terminal app is great, but there are …

Apps for better Terminal Experience in MacOs

About The Author

Subhro

Leave a Reply

Cancel reply

Recent Posts

  • 10 Insane Free Social Media Tools 
  • 10 Insane Digital Marketing Tools
  • 5 Incredible Tools for Technical Writers
  • 10 Insane Chrome Extensions
  • “8 Day to day amazing tech gifts that help you get organized.”

Recent Comments

  • MacUser on How to paste without formatting in MAC?
  • Mary on Convert to webp image format in a single click
  • Marcelo Miguel Bazan on Change WordPress admin email
  • Marcelo Miguel Bazan on Change WordPress admin email
  • Marcelo Miguel Bazan on Change WordPress admin email

Archives

  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • July 2021
  • May 2021
  • October 2020
  • April 2020
  • February 2020
  • December 2019
  • October 2019
  • September 2019
  • August 2019

Categories

  • Apple +
  • Gadgets +
  • Google +
  • How-To
  • MAC
  • Reviews +
  • Seo
  • Tech Tips
  • Web Tools +
  • Wordpress +

Techxplus

Categories

  • Apple +
  • Gadgets +
  • Google +
  • How-To
  • MAC
  • Reviews +
  • Seo
  • Tech Tips
  • Web Tools +
  • Wordpress +

Featured Posts

img 62ba1840a824c
img 62a8eadab762b
Tools for Technical Writers

LINKS

  • About Us
  • Privacy Policy
  • Cookie Policy
  • Disclaimer
  • Terms and conditions
  • Contact
Copyright © 2023 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