Username always wrong when SSH ‘ing someplace

Unix

22 Apr 2015

Username always wrong when SSH ‘ing someplace

Preston Garrison 0 Comments

When using a mac or Mobaxterm I have always had to specify -l root or whatever username I want to connect to the server with.  This gets very annoying, but there is a simple fix in ~/.ssh/config you can add the following:

 

User root

 

which will make it always use root as default.  You should also probably add 

 

ServerAliveInterval 30
ServerAliveCountMax 4

 

which is very handy for keeping ssh sessions from timing out.  Basically this just pings the server every 30 seconds, to let your firewalls know your still alive and not close the connection.

 

– Preston Garrison