Looking for a working example of sshd_config setup fille

Robert Moskowitz rgm at htt-consult.com
Mon Aug 18 12:58:19 UTC 2025



On 8/18/25 8:49 AM, Karl Auer wrote:
> On Mon, 2025-08-18 at 08:39 -0400, somebody[1] wrote:
>> Of course I took the hard way and changed the server port
>> which is a pain in Ubuntu which was never the case with
>> Centos/Fedora.
> In what way was it a pain?
>
> Regards, K.

Here are my notes.  I have changed the port I selected...

Change SSHD port:

cat /lib/systemd/system/ssh.socket

vi /lib/systemd/system/ssh.socket
ListenStream=1234

# mkdir -p /etc/systemd/system/ssh.socket.d
cd /etc/systemd/system/ssh.socket.d

vi /etc/systemd/system/ssh.socket.d/listen.conf
[Socket}
ListenStream=
ListenStream=1234

vi /etc/ssh/sshd_config.d/02-local.conf
ListenAddress 192.168.129.129:1234

vi /etc/ssh/sshd_config
Port 1234
PermitRootLogin no

systemctl daemon-reload
systemctl restart ssh.socket
netstat -tulpn


Meanwhile one system had an upgrade and I can no longer SSH into it.  I 
have to connect a monitor and keyboard to see what got hosed.  I have 
held off upgrading the other servers until I figure that out.

But a set of grandchildren (with parents) are visiting so such work is 
on hold for a week.   :)





More information about the ubuntu-users mailing list