1.  更改ssh端口

放置升级openssh之后做此步骤

配置文件/etc/ssh/sshd_config

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

注释掉Subsystem      sftp    /usr/libexec/openssh/sftp-server

 更改ssh,ftp默认端口 随笔 第1张

取消“#Port 22”   的#号,下面新加一行 Port 2554

修改/etc/service,将ftp和ssh的端口改成2553和2554.

#vim /etc/services

ftp    2553/tcp

ftp    2553/udp

ssh    2554/tcp

ssh    2554/udp

更改ssh,ftp默认端口 随笔 第2张

 重启sshd服务

Systemctl  restart  sshd.service

Xshell 重新连接新端口,成功则删除或注释配置文件Port  22字段

 更改ssh,ftp默认端口 随笔 第3张

然后重启sshd服务

Systemctl  restart  sshd.service

2.  更改ftp端口

修改配置文件

#vim  /etc/service

找到ftp这两行将21/tcp    21/udp  改为2553

 更改ssh,ftp默认端口 随笔 第4张

 

#vim /etc/vsftpd/vsftpd.conf

找到listen字段,改为listen=yes

 更改ssh,ftp默认端口 随笔 第5张

 

找到listen_ipv6=YES将其注释

 更改ssh,ftp默认端口 随笔 第6张

在文件末尾添加

Listen_port=2553

更改ssh,ftp默认端口 随笔 第7张

 

 #保存,退出

#systemctl stop vsftpd

#systemctl start vsftpd

#systemctl  enable  vsftpd

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄