HowTo: Change the default ssh configuration which by default uses the current logged in user-name, which isnt working for my ansible setup.
Solution : We can achive this by using the SSH Config File where we can customize the settings to override ssh default settings.
Create a file called
~/.ssh inside the file you can add:
Host * User john
Host nixtechnix HostName nixtechnix.com User john
In the first example we are setting a common user john for all remote ssh connections.
And in second example we are setting a hostname specific user, also with second configuration we wont be required to give full hostname for ssh connection. we can simply connect with