You must follow this if you’re a developer

developer tricks

Are you a developer? If yes, this articles is going to make your life easier.

Being a developer, we often have to deal with the live projects and connecting to the live sites server’s.

And if working with multiple live project handling, you’ll frequently require to connect to the hosts regularly.

So here’s a trick to make it easier.

First you’ll have to install sshpass, can install by running following command in your terminal:

> sudo apt install sshpass

Now go to /home/{youruser}/ and open .bashrc file in any editor ( Press Ctrl+H, if file not visible ).

Now let’s create a command alias, create a new line in .bashrc file as per your project details. For example:

alias connect-magentto=’sshpass -p “your ssh password here” ssh yourusername@yourhostname’

Copy paste above command in .bashrc file and save it and open a new terminal. Enter “connect-magento” in the terminal and now you’ll connect to the server without a copy, pasting, or typing anything.

Thank you.

Liked this? Help us spread this to the world 🙂

Leave a Reply