openEuler常用密令(跟着centos8走):
查看系统信息,命令如下:
cat /etc/os-release
查看CPU信息,命令如下:
lscpu
查看内存信息,命令如下:
free
查看磁盘信息,命令如下:
fdisk -l
查看IP地址,命令如下:
ip addr
关闭防火墙可参照如下命令
iptables -F
配置防火墙规则:如果服务器上启用了防火墙,确保允许 SSH 流量通过。你需要添加一个防火墙规则来允许 SSH 连接:
sudo firewall-cmd --add-service=ssh --permanent
sudo firewall-cmd --reload
停止防火墙:
systemctl stop firewalld
关闭防火墙:
systemctl disable firewalld
清除缓存
dnf clean all
------服务类密令
显示所有当前服务:systemctl list-units --type service
如果您需要显示所有的服务(包括未运行的服务),需要添加-all参数:
systemctl list-units --type service --all
如果您需要显示某个服务的状态:
systemctl status name.service
验证服务状态:
systemctl is-active httpd
停止服务:
systemctl stop name.service
重启服务:
systemctl restart name.service
-------------安装 SSH 服务器软件
sudo dnf install openssh-server
sudo systemctl start sshd
sudo systemctl enable sshd
-------------httpd的安装与服务启动。
# dnf install httpd -y
# systemctl start httpd
# systemctl enable httpd
-------------tftp的安装与配置:
# dnf install tftp-server -y
# vim /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
# systemctl start tftp
# systemctl enable tftp
# systemctl start xinetd
# systemctl status xinetd
# systemctl enable xinetd