[Solved] SSH port resets to 22 at System boot

This forum is for discussion about general software issues.

[Solved] SSH port resets to 22 at System boot

Postby motorxx » Sat Jan 06, 2018 8:32 am

Hello,

I have edited /etc/ssh/sshd_config to change The ssh port.
My issue is that ssh at system reboot starts listening in port 22, whatever port I have defined in /etc/ssh/sshd_config .

The only why to change The port is to stop sshd.socket Service and start it again.
If I restart The Service, it keep on listening in por 22

I tried to reinstall ssh several times with no success.

The only Solution that I have find out was to edit The file sshd.socket changing The listening port to My desired one.

i also copied My configuration files for another competer with no success.

If i turn iptables off, it keeps The same.

It is a new installation. Maybe I am missing something but I have not been able to find anything relates to gire me a clue.

Any idea?
Last edited by motorxx on Sat Jan 06, 2018 6:36 pm, edited 1 time in total.
motorxx
 
Posts: 17
Joined: Thu Nov 05, 2015 1:42 pm

Re: SSH port resets to 22 at System boot

Postby andre » Sat Jan 06, 2018 3:33 pm

As you mention the sshd.socket service, did you change it?

$this->bbcode_second_pass_code('', '/usr/lib/systemd/system/sshd.socket')

There it says by default
$this->bbcode_second_pass_code('', '
[Socket]
ListenStream=22
Accept=yes
')

So, I suppose there you should tell it another port to listen
andre
 
Posts: 68
Joined: Wed Jan 25, 2012 1:39 pm
Location: Eindhoven

Re: SSH port resets to 22 at System boot

Postby motorxx » Sat Jan 06, 2018 6:35 pm

Hello,

Yes I changed The listenStream = 22 to My desired port Number, and did made The trick and solved The issue I described in My First post.

I have better read The arch linux wiki about ssh and I found that I can not have working at The same time sshd.service and sshd.socket. This is what I was doing before and was wrong.

I have now disabled sshd.socket Service and My port configuration in sshd_config is working perfectly running just sshd.service.

I Mark The post as solved.

Thanks.
motorxx
 
Posts: 17
Joined: Thu Nov 05, 2015 1:42 pm


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests