系统相关
首页 > 系统相关> > Linux 学习Day 1

Linux 学习Day 1

作者:互联网

Systemd

RHEL 8中,init的工作由systemd替代了,所以之前的命令也发生了变化。

新的改变

如果安装了一个软件包之后,不知道服务的全名,可以使用systemctl list-unit-files | grep xxx 来查找一下服务的全名
以FTP服务举例:
查找服务全名:systemctl list-unit-files | grep ftp
服务启动:systemctl start vsftpd.service (服务名后的.service可以省略)
服务停止:systemctl stop vsftpd.service
服务重启:systemctl restart vsftpd.service
服务重载:systemctl reload vsftpd.service (仅重新加载配置文件,不停止服务)
服务状态查询:systemctl status vsftpd.service
服务开机自启:systemctl enable vsftpd.service
服务开机不自启:systemctl disable vsftpd.service
查看服务是否开机自启:systemctl is-enabled vsftpd.service

重置密码

如果忘记root账户的口令,可以使用如下方法进行重置:
1、在内核选择界面按e进入编辑模式:
在这里插入图片描述
2、在行后添加参数:rd.break,然后使用组合键ctrl+x执行:
在这里插入图片描述
3、进入救援模式:
在这里插入图片描述
4、执行以下命令重置密码:
mount -o remount,rw /sysroot
chroot /sysroot
passwd
touch ./autorelabel
exit
reboot
在这里插入图片描述

标签:服务,service,全名,重置,学习,vsftpd,systemctl,Linux,Day
来源: https://blog.csdn.net/Corvo_Attano/article/details/115428755