Ssh connectivity issues with ad-hoc commands, playbooks.yml, Ansible.

21 views
Skip to first unread message

gonzalo diaz larenas

unread,
Jun 14, 2023, 11:58:21 AM6/14/23
to Ansible Project
Dear
Good afternoon, sorry for the inconvenience, I'm just getting started with what Ansible is, specifically learning how to optimize daily tasks in laboratories. I set up a virtualized network with a central ansible server, from where I apply ad-hoc commands and automated playbooks.yml files that point to remote hosts, I managed to configure three machines with different Debian distributions, I can connect via ssh without any problem, each machine has the corresponding public key, which I copied from the central server, that is, every time I connect via ssh it does not ask me for a password, this is a fundamental requirement when applying ad-hoc or playbook commands, with these machines I have no problems of ssh connectivity. I wanted to expand the network by adding a group called ClientWindows to the inventory file, which will host computers with Microsoft Windows 10 Pro, via ssh I can connect directly to this type of machine without any problem, I also configure them so that they do not ask me for the password when applying ad-hoc or playbook.yml commands, but here comes a problem, every time I apply an ad-hoc or playbook.yml command it gives me connectivity problems via ssh (Permission denied), when I see the connectivity error I deduce that by default ssh points to the root user, but it turns out that I am trying to connect to a machine with Windows 10 Pro that has the administrator username, the strange thing about all this is that when I connect via ssh directly (ssh admini...@x.x.x.x ) I have no problem, in fact I have configured the ssh connection so that it does not ask me for a password, I am attaching a file with the details of what I mentioned earlier, I would appreciate your guidance, regards.

Problemas de conectividad ssh Windows.JPG

Prady A

unread,
Jun 15, 2023, 1:30:24 AM6/15/23
to ansible...@googlegroups.com
You are running the script from root user. So it is trying to connect root@ip not administrator@ip


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7d00c709-bc7b-4e50-8269-937c3a572ba3n%40googlegroups.com.

Thanh Nguyen Duc

unread,
Jun 15, 2023, 2:36:10 AM6/15/23
to ansible...@googlegroups.com
Need to specify your target ssh user.

On 15 Jun 2023, at 12:30, Prady A <pradyu...@gmail.com> wrote:


You are running the script from root user. So it is trying to connect root@ip not administrator@ip

On Thu, Jun 15, 2023 at 0:58, gonzalo diaz larenas <gonzalodi...@gmail.com> wrote:
Dear
Good afternoon, sorry for the inconvenience, I'm just getting started with what Ansible is, specifically learning how to optimize daily tasks in laboratories. I set up a virtualized network with a central ansible server, from where I apply ad-hoc commands and automated playbooks.yml files that point to remote hosts, I managed to configure three machines with different Debian distributions, I can connect via ssh without any problem, each machine has the corresponding public key, which I copied from the central server, that is, every time I connect via ssh it does not ask me for a password, this is a fundamental requirement when applying ad-hoc or playbook commands, with these machines I have no problems of ssh connectivity. I wanted to expand the network by adding a group called ClientWindows to the inventory file, which will host computers with Microsoft Windows 10 Pro, via ssh I can connect directly to this type of machine without any problem, I also configure them so that they do not ask me for the password when applying ad-hoc or playbook.yml commands, but here comes a problem, every time I apply an ad-hoc or playbook.yml command it gives me connectivity problems via ssh (Permission denied), when I see the connectivity error I deduce that by default ssh points to the root user, but it turns out that I am trying to connect to a machine with Windows 10 Pro that has the administrator username, the strange thing about all this is that when I connect via ssh directly (ssh admini...@x.x.x.x ) I have no problem, in fact I have configured the ssh connection so that it does not ask me for a password, I am attaching a file with the details of what I mentioned earlier, I would appreciate your guidance, regards.

<Problemas de conectividad ssh Windows.JPG>

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7d00c709-bc7b-4e50-8269-937c3a572ba3n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.

Prady A

unread,
Jun 15, 2023, 2:48:07 AM6/15/23
to ansible...@googlegroups.com
 in ansible.cfg configuration file you can specify 
Remote_user = administrator 

Reply all
Reply to author
Forward
0 new messages