修改服务器SSH默认连接22端口

栏目: 服务器 · 发布时间: 7年前

内容简介:我们都知道服务器 SSH 默认连接端口为 22,有时候出于安全方面的考虑需要修改默认的连接端口。那怎么修改服务器ssh端口呢?修改ssh默认端口该怎么操作呢?

我们都知道服务器 SSH 默认连接端口为 22,有时候出于安全方面的考虑需要修改默认的连接端口。

下面就介绍一下修改 SSH 端口的方法:

步骤1:编辑ssh配置文件

vi /etc/ssh/sshd_config

查找到如下字段:

# If you want to change the port on a SELinux system, you have to tell 
# SELinux about this change. 
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER 
# 
#Port 22 
#ListenAddress 0.0.0.0 
#ListenAddress ::

把其中的Port 22修改为:

Port 123

步骤2:重启SSH服务

service sshd restart

OK,大功告成!


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Elements of Programming

Elements of Programming

Alexander A. Stepanov、Paul McJones / Addison-Wesley Professional / 2009-6-19 / USD 39.99

Elements of Programming provides a different understanding of programming than is presented elsewhere. Its major premise is that practical programming, like other areas of science and engineering, mus......一起来看看 《Elements of Programming》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具