Good morning,
I have the latest dietpi installed on raspberry pi 3 model B and Home-Assistant-supervised and a pizigate gateway.
The problem is: I can’t change SSH port 22.
I have dropbear installed. However, I modified port 22 in the configuration file but that doesn’t change anything. Here is the configuration file and the result of the command placed with the port.
dietpi@DietPi:/etc/init.d$ cat dropbear
#!/bin/sh
### BEGIN INIT INFO
# Provides: dropbear
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Lightweight SSH server
# Description: Init script for drobpear SSH server. Edit
# /etc/default/dropbear to configure the server.
### END INIT INFO
#
# Do not configure this file. Edit /etc/default/dropbear instead!
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dropbear
NAME=dropbear
DESC="Dropbear SSH server"
DEFAULTCFG=/etc/default/dropbear
PIDFILE="/run/$NAME.pid"
DROPBEAR_PORT=12345
DROPBEAR_RECEIVE_WINDOW=65536
DROPBEAR_EXTRA_ARGS=""
Dell-Latitude:~$ ssh -vvv dietpi@mypc.ddns.net -p12345
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -'/home/toto/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -'/home/toto/.ssh/known_hosts2'
debug2: resolving "mypc.ddns.net" port 12345
debug3: resolve_host: lookup mypc.ddns.net:12345
debug3: ssh_connect_direct: entering
debug1: Connecting to mypc.ddns.net [xx.xx.xxx.xxx] port 12345.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: connect to address xx.xx.xxx.xxx port 12345: Connection refused
ssh: connect to host mypc.ddns.net port 12345: Connection refused