博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
修改Liunx服务器SSH端口
阅读量:7236 次
发布时间:2019-06-29

本文共 382 字,大约阅读时间需要 1 分钟。

为提高Linux系统安全性,我们经常会修改ssh端口,下面以CentOS 6为例:

vi /etc/ssh/sshd_config

修改ssh端口,默认配置如下:

a.png

修改为自己想要的端口号(小于65535,不要和常用服务端口号冲突),如下图的5678:

b.png

重启ssh服务,则端口号生效

service sshd restart

c.png

 

还有更重要的一点不要忘记:修改iptables规则,放行ssh新端口

vi /etc/sysconfig/iptables

d.png

重启iptables服务

service iptables restart

保存,重启不丢失

/etc/rc.d/init.d/iptables save

 

这时就可以尝试用新端口测试ssh连接服务器了。

转载于:https://www.cnblogs.com/woaixingxing/p/11077295.html

你可能感兴趣的文章
UVa 127 - "Accordian" Patience POJ 1214 链表题解
查看>>
oracle中Window和Window Group
查看>>
WCF NetTcpBinding Transport安全模式(3) ProtectionLevel设置保护级别
查看>>
WinRAR命令行参数[转]
查看>>
Microsoft Enterprise Library 5.0 系列教程(三) Validation Application Block (高级)
查看>>
使用Container.ItemIndex获取Repeater、Gridview行的序号的简单方法
查看>>
F#系列随笔索引
查看>>
Mac OS X 10.10优胜美地怎样完美接管iphone上的电话和短信
查看>>
dotnet程序优化心得(一)
查看>>
妙趣横生的算法--二叉树
查看>>
发布了Android的App,我要开源几个组件!
查看>>
PHP foreach使用
查看>>
《基于MFC的OpenGL编程》Part 13 Creating 2D and 3D Text
查看>>
HTML5 移动浏览器支持
查看>>
[LeetCode] Next Closest Time 下一个最近时间点
查看>>
【AngularJS】—— 4 表达式
查看>>
[LeetCode] Surrounded Regions
查看>>
【Android布局】在程序中设置android:gravity 和 android:layout_Gravity属性
查看>>
U盘启动笔记本无法安装Win7问题和解决
查看>>
基于SignalR的站点有连接数限制问题及解决方案
查看>>