[Solved] Cant get no ssh connection with switch in linux
Hello everyone,
In Home Assistant i want to make a ssh connection with the switch (I have the docker version of Home Assistant with version 2023.5.3). This is because i want to make a python script to enable or disable PoE on a specific port. Alas I cannot get a connection. i tried to generate a rsa public and private key with 2048 bits with ssh-keygen. The SSH-server on the switch is enabled. I downloaded the public key in the switch. I tried to copy the public key to ~/.ssh/authorized_keys with ssh-copy-id. Both the public key and ~/.ssh/authorized_keys have file permissions of 600. But when using ssh-copy-id i get an error: Unable to negotiate with switch_ip port 22: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1. In ~/.ssh/config i added some algorithms:
Host jetstream
hostname ip_address
KexAlgorithms diffie-hellman-group1-sha1
HostKeyAlgorithms +ssh-dss
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc,3des-cbc,
user admin
PreferredAuthentications publickey
IdentityFile id_rsa
Host *
KexAlgorithms curve25519-sha256...
I get ping replies from the switch in Home Assistant. When I put the line PreferredAuthentications publickey, password in ~/.ssh/config I can connect to the switch. It is asking for a password, but that is not what I want. What am I missing? Will someone please help me?