linux 禁止22端口号
重启防火墙命令
#systemctl restart iptables.service
查看端口号
#iptables -L
首先修改配置文件 vi /etc/ssh/sshd_config 增加新端口号
PermitRootLogin yes
Port xxxxx
#Port 22
保存退出(一般需要先保留22,测试新端口可以连接后再回来注释掉)
执行重启防火墙命令:systemctl restart sshd.service
--------------------
centos7重启防火墙(iptables)命令#service iptable restart报出异常
下面命令也是异常
/etc/init.d/sshd restart
-bash: /etc/init.d/sshd: No such file or directory
----------------------
编辑防火墙配置:vi /etc/sysconfig/iptables
#-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport xxxxx -j ACCEPT
执行:systemctl restart sshd.service
用ssh工具连接xxxxx端口测试是否成功。如果连接成功了,则再次编辑sshd_config的设置,将里边的Port22删除
linux 禁止22端口号的更多相关文章
- Linux增加开放端口号
Linux增加开放端口号 : 方法一:命令行方式 1. 开放端口命令: /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT 2.保存:/etc/ ...
- linux中查看端口号
linux中查看端口号 yum install lsof -y [root@test1 ~]# lsof -i :80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF ...
- linux各种查看端口号
1. 查看端口占用情况的命令:lsof -i [root@www ~]# lsof -i COMMAND PID USER FD TYPE DEVICE SIZE NODE N ...
- Linux更改ssh端口号,很easy!
因为公司业务需求,可能涉及到更改ssh远程的端口号,用下面方法轻松解决,废话不多说! 1.打开ssh端口配置文件:vim /etc/ssh/sshd_config,找到如下图所示的端口,改为自己想改的 ...
- Linux 开放指定端口号
1.开启防火墙 [root@localhost opt]# systemctl start firewalld 2.查看当前防火墙状态 [root@localhost opt]# systemctl ...
- linux 修改ssh端口号
vi /etc/ssh/sshd_config 找到#Port 22一段,这里是标识默认使用22端口,修改为如下: 代码如下 复制代码 Port 22 Port 50000 然后保存退出 执行/et ...
- linux设置预留端口号,防止监听端口被占用 ip_local_reserved_ports
1. 背景 linux服务器启动时,会对指定的端口进行监听bind,如果同一个机器上这个端口已经被使用,则监听失败,程序无法启动. linux客户端连接服务器accept时,系统会分配本地临时端口用于 ...
- 查看linux的shhd端口号 netstat | grep sshd
[root@iZ2zef51hufoaycipfxek8Z ~]# [root@iZ2zef51hufoaycipfxek8Z ~]# netstat | grep sshd [root@iZ2zef ...
- 修改linux的ssh默认端口号22的方法
一.修改配置文件 vi /etc/ssh/sshd_config 找到#Port 22 修改为自己要使用的端口号:Port 26000 然后 :x 退出保存 二.重启ssh服务 /etc/init. ...
随机推荐
- 【JMeter】前置处理器
BeanShell PreProcessor 使用BeanShell在请求进行之前进行操作.语法使用与BeanShell Sampler是一样的.但可使用的内置变量稍有不同 JDBC Pre ...
- 报错解决——Failed to load resource: the server responded with a status of 404 (Not Found) favicon.ico文件找不到
Django项目开发完成后在本地运行没问题,但在推到服务器上后出现报错Failed to load resource: the server responded with a status of 40 ...
- git diff 与 git diff --cached的不用
git diff比较的是工作目录中当前文件和暂存区域快照之间的差异, 也就是修改之后还没有暂存起来的变化内容.若要查看已暂存的将要添加到下次提交里的内容,可以用 git diff --cached 命 ...
- cube-ui中弹窗
if (!this.surname) { this.$createDialog({ type: "alert", icon: "cubeic-close", s ...
- Html-根据不同的分辨率设置不同的背景图片
@media only screen and (min-width: 1024px) //当分辨率width >= 1024px 时使用1.jpg作为背景图片 { ...
- PHP自动加载SPL的四种处理方式
libs目录下有3个类文件: Test.class.php <?php class Test { public function __construct() { echo "Loadi ...
- GRU门控制循环单元【转载】
转自:https://www.infoq.cn/article/sliced-recurrent-neural-networks 1.门控循环单元 GRU GRU 由 reset gate r 和 u ...
- Py-numpy的随机函数【转载】
转自:https://blog.csdn.net/u012149181/article/details/78913167 1. numpy.random.rand() numpy.random.ran ...
- testNG中dataprovider使用的两种方式
testNG的参数化测试有两种方式:xml和dataprovider.个人更喜欢dataprovider,因为我喜欢把测试数据放在数据库里. 一.返回类型是Iterator<Object[]&g ...
- Hybrid设计--如何落地一个Hybrid项目
前后分离 -> 统一前端框架 -> 同一个账号体系 -> 登录注册的公共页 -> 有了这些公共业务后 推行 -> Hybrid 技术 底层容器开发出来后 -&g ...