
Since rest of account do not have any password, it is necessary to prevent non-root users from logging into the system. Step # 4 Block all non-root login Block all non-root (normal) users until we fix all password related problems. Reboot the system in full multiuser mode: Rebuild /etc/shadow file from /etc/passwdġ) You need to use pwconv command it creates /etc/shadow from /etc/passwd and an optionally existing shadow.Ģ) Use passwd command to change root user password:ģ) Now root account are ready to go in multi-user mode. This will allow us gain root privileges (w/o password) and a root shell.ĭo not forget to (re)mount your rest of all your partitions in read/write (rw) mode such as /usr /var etc (if any) This causes the system to boot the kernel and run /bin/bash instead of its standard init. Press enter key to exit edit mode.Ĥ) Back at the GRUB screen, type b to boot into single user mode. Select the line that starts with kernel and type e to edit the line.ģ) Go to the end of the line and type init=/bin/bash as a separate one word (press the spacebar and then type init=/bin/bash). Select Recovery mode the version of the kernel that you wish to boot and type e for edit. However, ftp was working fine because proftpd was build using MySQL database for authentication and quota management.īoot server into single user mode1) Reboot serverĢ) Next, you will see grub-boot loader screen. Well all it started when one of our client accidentally deleted /etc/shadow file from co-located Debian Linux server. How do you fix such problem in a production environment where time is critical factor? I will explain how to recover deleted /etc/shadow file in five easy steps. If you boot into single user mode, system will ask root password for maintenance, and just imagine you do not have a backup of /etc/shadow file. The -symbols option allows to include at least one special character.Sometime by accident you may delete /etc/shadow file. Additional options can be used to generate password without numbers or capital letters: pwgen 8 1 -no-numerals -no-capitalize uihuuhieīy default, special characters not included in the password.

Only one password will be generated with length of 8 characters: eheih3Luīy default, pwgen includes at least one number and one capital letter in the password. The number of passwords to generate can be provided as second argument: pwgen 8 1 You can provide the password length as first argument: pwgen 12 ui5uuzoh2Iet hooBuo2gooW4 aax9Phei2ush oochao0xaiP2 kae6Zeengait unozi9iuPh2i Jes1quae ieShah9u zeeG3Pah aicil9Yi Goo1eiqu ah7mohPh Aqueene4 Ahqu4iep Vee6Eing eicieN2i Xi1pheeV Epa9puce ciaqu5Pe zighai5Z Aegha2ah LiPhee8p eghaeW1c Hai0Ahy9 riz5weGh Fohj4Ogi aiz9Diol Huphoh7f Taez2Bei xau9Phoo Run the pwgen command without any arguments: pwgenīy default, pwgen generates 160 passwords which are 8 characters in length. Install pwgen: sudo apt install -y pwgen Testing pwgen Install pwgenĮxecute the following command to update the package lists: sudo apt update This tutorial shows how to install pwgen on Ubuntu 20.04. This tool is designed for generating secure passwords which can be easily memorized by humans.

The pwgen is a tool that enables to generate random passwords via command line.
