Exception caught while starting SSH server; port already in use (solved)

I am getting

2017-02-21 09:50:29.769 [WARN ] [org.apache.karaf.shell.ssh.Activator] - Exception caught while starting SSH server
java.net.BindException: Address already in use

on my Synology NAS. Nevertheless OH2 seems to be running fine. I could ignore this excepetion but I am curious to know why OH would try to start his own SSH server. There is already an SSH server running on my Syno NAS.

Is it possible to prevent OH from doing this and to get rid of this exception?

Thanks for your thoughts!

Interesting one … i have the same problem with my DS916+

Tried to change the port in services dir (file with ssh.cfg at the end), but that resulted in complete oh2 failure while starting…

OH2 is running fine, but I can´t open a ssh connection ( i wonder why :slight_smile: :slight_smile: )

I´m using the openhab/openhab docker (stable version)

Oh2 does start is own SSH server for access to the karaf console, but it starts it on a non standard port (8101 I think). This server is set up to only accept connections from local host.

I don’t know if there is a way to change this port but I would be more concerned with what other service you have running that is using that port and making sure it anyways starts before oh does. Otherwise that service will fail with a bind error.

For Docker you can look into the docker postings on this forum for “macvlan” for a way to run the OH container on its own network stack complete with is own IP which will avoid these problems.

Thanks @rlkoshak, that helps. Some investigation revealed that it is the DVB Logic TV server on my Synology which is using port 8101.

But at this point I am unsure how to continue. One of both applications need to change the port. Should it be openhab or DVBLink? I would prefer to continue running DVBLink on the default ports. Otherwise I would have to adjust the port for each and every client (which are some).

Is it possible to change the port of the openhab ssh server?

Thanks for any hint.

Hi @ampeer

openhab2 ssh port can be changed by editing this file.

/var/lib/openhab2/etc/org.apache.karaf.shell.cfg

You are looking for
sshPort = 8101

It’s right at the top of the file.

Thanks @chriscolden,

this did the trick. I changed the port to 8102. No more log errors.

Just for the record: the path to the karaf config file on syno NAS is
/volume1/@appstore/openHAB2/userdata/etc

Thanks everybody for your help!

No problem. Glad I could help. I thought the path might be different but wasn’t sure what it might be as I run OH2 off a raspberry pi.

I’ve just created a little post documenting our findings and file locations including the path you have provided.

2 Likes

confirmed … that works fine …

Thank you guys