Add Default User Name to SSH Connect

Last modified: 
Monday, October 19th, 2015
Topics: 
SSH

Adding the following to ~/.ssh/conf will enable you to connect as myusername@example.com without prefixing myusername@ to the connection string.

The second entry is a catchall which will allow you to automatically connect as myusername@anysite.example.com.

Host example
  User myusername
  HostName example.com
  Compression yes
  AddressFamily inet

Host *
  User mysuername
  Compression yes
  AddressFamily inet


The operator of this site makes no claims, promises, or guarantees of the accuracy, completeness, originality, uniqueness, or even general adequacy of the contents herein and expressly disclaims liability for errors and omissions in the contents of this website.