Will & Skill Developers

Will & Skill Developers


Thoughts, snippets and ideas from the team at Will & Skill AB, Stockholm.

Hassan Mian
Author

Don't let someone else's opinion of you become your reality. - Les Brown

Share


Create shortcuts to your SSH servers by editing ~/.ssh/config

Hassan MianHassan Mian

Run the following command in your terminal

nano ~/.ssh/config

Paste

host <nameofshortcut>
  hostname <urlofserver>
  user     <yourusername>

If you wanted to create a shortcut to github.com you can do something like

host github
  hostname ssh.github.com
  user     git

Lets assume that you have a server that you want to name myvps, the url is 1.2.3.4 and that your username is mickeymouse.

Our config would then look like

host myvps
  hostname 1.2.3.4
  user     mickeymouse

Now you can do

clone github:willandskill/django-parse-push.git

NOTE: The configurations above assumes that your SSH Public key is located in ~/.ssh/ and is named id_rsa

You can also set a specific port and private key

host example
  hostname www.example.com
  user johndoe
  port 2222
  identityfile ~/.ssh/myprivatekey

You can enforce certain security measures byt pasting the snippet below at the top of ~/.ssh/config

host *
  identitiesonly yes
  serveraliveinterval 60
  passwordauthentication no
  challengeresponseauthentication no
Hassan Mian
Author

Hassan Mian

Don't let someone else's opinion of you become your reality. - Les Brown

Comments