不会编程 做网站,济南哪个公司做网站好,高端营销型网站建设,多语言网站多域名推广一 方案与思路
0 xshell客户端监测是否能够ping通目标服务器。 前提#xff1a;知晓目标服务器IP地址 Linux: ifconfig -aWindows: ipconfig -a1 利用firewall工具#xff0c;检查是否已开启ssh的22端口。若无#xff0c;则#xff1a;开启22端口2 利用sshd工具#xff0…
一 方案与思路
0 xshell客户端监测是否能够ping通目标服务器。 前提知晓目标服务器IP地址 Linux: ifconfig -aWindows: ipconfig -a1 利用firewall工具检查是否已开启ssh的22端口。若无则开启22端口2 利用sshd工具检查是否已开启sshd服务。若无则开启sshd服务 开(重)启ssh服务 system (re)start sshd3 利用systemctl工具检查是否已开启sshd、firewalld的开机自启服务。若无则开启sshd、firewalld服务的开机自启 systemctl enable sshdsystemctl list-unit-files | grep sshdsystemctl enable firewalld[.service]systemctl list-unit-files | grep firewall
回到顶部
二 相关知识及操作命令 关键工具 ssh客户端主要进行服务器端的连接 sshd服务端作用于服务器端开闭ssh服务等操作 ssh————————————sshd client serve firewalld(防火墙) firwall-cmdLinux提供的操作firewall的一个工具 systemctl(服务控制命令) 1 sshd
查看服务状态inactive(不可用)active可用活动状态 systemctl status sshd列出已开启服务当前状态
systemctl list-units | grep 目标服务例如ssh
或
netstat -antulp | grep ssh开启ssh服务
systemctl start sshd设定服务开机启动
systemctl enable sshd查看sshd开机自启服务是否已开启
systemctl list-unit-files | grep sshd关闭ssh服务
systemctl stop sshd设定服务开机不启动
systemctl disable sshd重启ssh服务
systemctl restart sshd重新加载服务配置
systemctl reload sshd2 防火墙
2.1 查看
查看firewall服务状态
systemctl status firewalld查看防火墙状态
firewall-cmd --state 查看防火墙规则
firewall-cmd --list-all查询端口是否开放
firewall-cmd --query-port8080/tcp2.2 操纵
1.2.1 firewall端口
开放端口例如80端口 --permanent表示设置为持久 --add-port标识添加的端口 firewall-cmd --permanent --add-port80/tcp移除端口
firewall-cmd --permanent --remove-port8080/tcp1.2.2 firewall服务
开启
service firewalld start重启
service firewalld restart
# 或者↓
firewall-cmd --reload 【重启防火墙(修改配置后要重启防火墙)】启用/禁用 开机自启
systemctl enable/disable firewalld.service关闭
service firewalld stop2.3 补充 CentOS6的防火墙操作
# 查看防火墙状态
service iptables status# 停止防火墙
service iptables stop# 启动防火墙
service iptables start# 重启防火墙
service iptables restart# 永久关闭防火墙
chkconfig iptables off# 永久关闭后重启
chkconfig iptables on