[SOLVED] Can't ping the server with ansible script

alhex

New Member
Sep 3, 2025
6
0
1
Hello everyone,
I followed a few tutorials to automate my proxmox server and i got stuck really fast, can you please suggest a troubleshoot method or a possible solution?

Situation:
I am using a Windows PC with wsl 2 and ubuntu in Visual studio, the server is on a old laptop (192.168.1.130)
If i try to ssh directly, it works, as soon as i try to ping... it fails

1756889732788.png
And i have all the files i need (in my opinion)
1756889773884.png
1756889794720.png
1756889923742.png

This is the server
1756890016147.png
1756890081504.png

If anyone can see something wrong please let me know.
Thank you
 
Last edited:
Hello,
the error is: "permission denied (publickey,password)."
Please check the permissions of the authorized_keys file and the .ssh directory.
SSH works when connecting directly because the SSH client falls back to password authentication.
 
Thank you for the answer.

On the server side i have
1756894480979.png

And local (Home_Server is the privat key)

1756893931880.png
1756894393264.png
 

Attachments

  • 1756891851325.png
    1756891851325.png
    16.7 KB · Views: 4
  • 1756891985574.png
    1756891985574.png
    13.5 KB · Views: 4
Last edited:
The best way to key key based authentication working is to use "ssh-copy-id", if you have it on your client.

If you don't, then carefully take the context of your id_rsa.pub from windows host, and place its context as single line , adding it to the end of "authorized_keys" on the PVE.

Make sure you have an established ssh session running, as if you break the file by bad edit you may have issues logging in.
Keep an eye on windows vs unix end of line characters, line breakage, etc.

Cheers


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
@alhex ,
Just because Ansible calls an operation “ping” doesn’t mean it’s actually doing an ICMP ping.

For a web server, “ping” in Ansible might mean making a curl connection to port 80/443. In your case, it’s “pinging” the SSH port by attempting an SSH connection. That connection is being denied with: permission denied (publickey, password)

If you can SSH manually with your key, then Ansible is likely not using the same key. Why that’s happening is outside the scope of PVE installation/configuration, but if you track it down, do post your findings here.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:
@alhex
you are using a different ssh key in your ansible inventory in comparison to your working ssh command:
/home/ansiblepilot2/.ssh/... vs ~/.ssh/... ( Note: ~ will be translated to /root/ not /home/ansiblepilot2/ when you execute the command as root user)
 
  • Like
Reactions: bbgeek17
i got a bit closer...but still now working :D

I started the connection in debug mode
1756911950745.png

lots of bla bla, it didn't searched for my privat key, and then i see this.....
1756912110571.png

it was searching for something ed25519 related (this is the key type i generated)
So i renamed my privet key "id_ed25519"

Now i am here
1756912274309.png

asche:

i updated the inventory and nothing changed :/
1756912335737.png