linux服务问题传文件连不上问题远程问题等

通过iptables相关命令实现防火墙的打开和关闭
1.首先可以在打开的终端使用iptables --help查看帮助使用命令;
2.查看防火墙状态:service iptables status(此命令可以查看防火墙是打开还是关闭);
3.service iptables常接参数:
(1)service iptables stop关闭防火墙;
(2)service iptables start开启防火墙;
(3)service iptables reload重新加载防火墙;
(4)service iptables restart重启防火墙;
4.永久关闭/打开防火墙
chkconfig iptables off 永久关闭防火墙;
chkconfig iptables on永久打开防火墙;

使用 systemctl 列出所有服务
systemctl list-units --type=service --all

使用 systemctl 列出正在运行的服务
systemctl list-units --type=service --state=running

使用 systemctl 列出禁用的服务
systemctl list-unit-files --state=disabled

检查服务是否处于活动状态或已启用
要查看服务是否处于活动状态或已启用,您需要在特殊命令后输入该服务名称,如下所示:
systemctl is-active
systemctl is-enabled

安装ssh服务
sudo apt install ssh

但是在ssh这个服务器的时候还是ssh失败:
systemctl status sshd.service #显示状态是inactive
systemctl restart sshd.service

posted @   Ryan9399  阅读(4)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
点击右上角即可分享
微信分享提示