Reset root password Centos 7

  • Reboot your Linux box and on the Linux Kernel boot screen press up or down arrow key to stop the Linux kernel from booting.
  • Then select the kernel version for which you want to reset the password and press ‘e’ to edit the kernel parameter.

1.Img-1

  • After entering the edit mode look for the line linux16, move your cursor to the end of the line and enter “rd.break” as shown in below image and enter “CTLR + x” to reboot the kernel.

2.img.2

  • Now run following command in sequence
    • mount -oremount,rw /sysroot
    • chroot /sysroot
    • passwd root
    • touch /.autorelabel
  • Now set your your root password and enter “exit” twice to reboot your system.
  • Now login with the new password you have set.

3.img.3

Enable SAMBA sharing without password

 

  • When enabling the file sharing, by default SAMBA server will prompt for the password while accessing the share folder.
  • To remove the password prompt you can edit “smb.conf” file located in “/etc/samba” location and change the below mention settings
  • security = share
  • If you want to revert the settings and configure SAMBA server to prompt for the password , you can edit the file and replace “share” with “user” as shown below.
  • security = user
  • Don’r forget to restart the server after editing the SAMBA configuration file
  • /etc/init.d/smbd restart