Run a script at boot time in CentOS 7

By default /etc/rc.local and /etc/rc.d/rc.local are no longer executable in CentOS7 with the new systemd-changes. Follow the below steps to make the script /root/ run at boot time:

1. chmod +x /etc/rc.d/rc.local
2. chmod +x /root/
2. Mention your script at the bottom of the file /etc/rc.local (/etc/rc.local is a symlink to /etc/rc.d/rc.local)as below :

sh /root/

Restart and check 🙂

Reset the password from single user mode in CentOS7

While booting up your machine, select the existing kernel and press ‘e’


Replace the entry ‘ro‘ with ‘rw init=/sysroot/bin/sh’


changed to


Press ctrl+x to save and start single user mode using the bash shell we mentioned above.

Run the below command and change password after that:

chroot /sysroot



Update selinux parameters as below :

touch /.autorelabel


Now reboot your machine. It may take some time to apply the apply the changes while booting up.


Thanks 🙂