# SSH Access to the Remote servers

**URL:** <https://forum.ansible.com/t/ssh-access-to-the-remote-servers/29899>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [March 17, 2019, 10:13am UTC](https://forum.ansible.com/t/ssh-access-to-the-remote-servers/29899 "2019-03-17T10:13:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillermo\_Colmena](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Guillermo\_Colmena](https://forum.ansible.com/u/Guillermo_Colmena)\
**Post date:** [March 17, 2019, 10:13am UTC](https://forum.ansible.com/t/ssh-access-to-the-remote-servers/29899/1 "2019-03-17T10:13:50Z")

</div>

Hi Ansible Community,

I have been trying to configure the ssh.cfg and ansible.cfg to be able to access using an id\_rsa to connect via ssh to the remote servers. The question comes when I try to configure these 2 config files. Any main steps that are needed to take to make it work?

Files:

- ssh.cfg
- ansible.cfg

I am also checking my AWS rules as it could be a rule blocking ssh external access.

Thanks a lot,  
Kind regards,  
Guille

---

<div class="post-metadata">

**Author:** ![Sebastian\_Meyer](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@Sebastian\_Meyer](https://forum.ansible.com/u/Sebastian_Meyer)\
**Post date:** [March 17, 2019, 4:48pm UTC](https://forum.ansible.com/t/ssh-access-to-the-remote-servers/29899/2 "2019-03-17T16:48:50Z")

</div>

Hi Guille,

> I have been trying to configure the ssh.cfg and ansible.cfg to be able to  
> access using an id\_rsa to connect via ssh to the remote servers. The  
> question comes when I try to configure these 2 config files. Any main steps  
> that are needed to take to make it work?
> 
> Files:
> 
> - ssh.cfg

I guess you are talking about the ssh\_config file. Since Ansible uses  
the systems ssh client (OpenSSH most likely), the config file for ssh  
has to be in a location OpenSSH is looking for it.

On Linux that'd be /etc/ssh/ssh\_config for the system-wide config or  
$HOME/.ssh/config for a single users config.

The $HOME/.ssh directory has to have 700 or rwx------ permissions.

In there you just specify

Host myhost.example.com  
&nbsp;&nbsp;IdentityFile /path/to/your/private/key

Afterwards the first thing you should check is, if normal ssh works as  
expected.

> - ansible.cfg

You should not need to specify anything here. If you need to keep your  
ssh\_config in a location the systems SSH client wouldn't look for it,  
you probably could add a

-F /path/to/your/ssh/config

to the ssh\_args parameter.

HTH  
Sebastian
