ubuntu 23.04安装完后,修改ssh端口问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
virtual163
帖子: 41
注册时间: 2018-01-30 12:55
系统: ubuntu 23.04
来自: china
联系:

ubuntu 23.04安装完后,修改ssh端口问题

#1

帖子 virtual163 » 2023-04-14 8:47

ubuntu23.04测试版安装后,安装完openssh-server后修改默认端口问题;
安装后默认端口是22端口,如下图:
Screenshot from 2023-04-14 08-42-58.png
修改文件为/etc/ssh/sshd_config
Screenshot from 2023-04-14 08-43-52.png
重启后的结果
Screenshot from 2023-04-14 08-46-04.png
重新载入后的结果
Screenshot from 2023-04-14 08-47-04.png
现在是这样的结果 ,不知道应该怎么样操作呢, 是系统的问题, 还没有修复呢, 还是别的问题呢
头像
astolia
论坛版主
帖子: 6703
注册时间: 2008-09-18 13:11

Re: ubuntu 23.04安装完后,修改ssh端口问题

#2

帖子 astolia » 2023-04-14 10:15

你第二张图里的第一段注释文字可能是原因

https://manpages.ubuntu.com/manpages/ki ... fig.5.html
Note: On Ubuntu, the openssh-server package is configured to use systemd socket-
based activation by default. Therefore if you are using systemd with the default
configuration, Port options will not be honored. Address configuration must be
handled in /etc/systemd/system/ssh.socket.d instead.
virtual163
帖子: 41
注册时间: 2018-01-30 12:55
系统: ubuntu 23.04
来自: china
联系:

Re: ubuntu 23.04安装完后,修改ssh端口问题

#3

帖子 virtual163 » 2023-04-14 12:56

astolia 写了: 2023-04-14 10:15 你第二张图里的第一段注释文字可能是原因

https://manpages.ubuntu.com/manpages/ki ... fig.5.html
Note: On Ubuntu, the openssh-server package is configured to use systemd socket-
based activation by default. Therefore if you are using systemd with the default
configuration, Port options will not be honored. Address configuration must be
handled in /etc/systemd/system/ssh.socket.d instead.
应该是这个原因, 新系统装完后没有这个文件夹和文件
/etc/systemd/system/ssh.socket.d/addresses.conf
试着手动创建了文件也不行,端口还是修改不了。
virtual163
帖子: 41
注册时间: 2018-01-30 12:55
系统: ubuntu 23.04
来自: china
联系:

Re: ubuntu 23.04安装完后,修改ssh端口问题

#4

帖子 virtual163 » 2023-04-14 12:57

virtual163 写了: 2023-04-14 12:56
astolia 写了: 2023-04-14 10:15 你第二张图里的第一段注释文字可能是原因

https://manpages.ubuntu.com/manpages/ki ... fig.5.html
Note: On Ubuntu, the openssh-server package is configured to use systemd socket-
based activation by default. Therefore if you are using systemd with the default
configuration, Port options will not be honored. Address configuration must be
handled in /etc/systemd/system/ssh.socket.d instead.
应该是这个原因, 新系统装完后没有这个文件夹和文件
/etc/systemd/system/ssh.socket.d/addresses.conf
试着手动创建了文件也不行,端口还是修改不了。
我用着正常的系统是从22.04升上来的, 没有问题, 新的镜像安装完后就会有这样的问题。
virtual163
帖子: 41
注册时间: 2018-01-30 12:55
系统: ubuntu 23.04
来自: china
联系:

Re: ubuntu 23.04安装完后,修改ssh端口问题

#5

帖子 virtual163 » 2023-04-19 17:06

ubuntu 23.04快发布了, 今天用的是4月18号发的镜像,在thinkpad T14 Gen2的笔记本上用新硬盘进行了安装测试,发现装完后风站逛转,进不了桌面,还有用虚拟机测试发现, ssh端口还是修改不了。
回复