VS Code Terminal Window: How to automatically ssh to openhab server

Sorry, i forgot it.

C:\Windows>ssh jonas@synology -i \192.168.1.20\docker\openhab\id_rsa -p8101
Warning: Identity file \192.168.1.20\docker\openhab\id_rsa not accessible: No such file or directory.
ssh: connect to host synology port 8101: Connection refused

EDIT:

I did your guide again from scratch and i can connect again manually now at least.
If i put this in the terminal:

ssh jonas@192.168.1.20 -i \192.168.1.20\docker\openhab\id_rsa -p8101

VSCode does not reconnect automatically but i can live with that.
But it throws a warning at me:

Warning: Identity file \192.168.1.20\docker\openhab\id_rsa not accessible: No such file or directory.

But it connects. :slight_smile:

The path to the file is not correct. The file id_rsa is not found.
The path needs to use a valid path towards that file.

Where did you get this path from? If using ssh with public key, just copy the private key to the client that connects with the ssh server. Then use the local file to connect

Please be aware that you don’t need a key if using password login, but the whole idea of key files is not to use passwords though the connection.
If creating the key pair without setting a password, you will no longer need to provide a password at all, and that’s no security issue, as long as you keep your private key, ehm… private…

Ok.
I got it :wink: I was storing the private file on my server as well since i use it on multiple computers. not such a good idea, i agree.
I changed it :wink:

I found out why it broke:

The org.apache.karaf.shell.cfg is overwritten when switching between versions with docker so the ssh host hast o be set to 0.0.0.0 again.

Regards

Jonas