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 @ 2025-02-24 15:16  Ryan9399  阅读(251)  评论(0)    收藏  举报