Создайте генератор паролей с помощью сценариев оболочки
Опубликовано: 16 Февраля, 2022
Создание надежного пароля часто является трудоемкой задачей, и даже после того, как вы создадите надежный пароль самостоятельно, хакеры взломают его. В этой статье мы узнаем, как создать надежный пароль, который удовлетворяет всем требованиям, включая символы, длину заглавных букв и т. Д., С помощью простого сценария оболочки в Linux.
How to create a password generator using shell script ?
This a simple short and quick method, just open the nano editor with .sh file using this command –
nano passwdgen.sh
You can use any name of the file.
#!/bin/bash # this can be anything of your choiceecho "Welcome to simple password generator" # ask the user how much long should beecho "please enter the length of the password" # read the input given by user and store in variableread PASS_LENGTH # loop will create 5 passwords according to# user as per length given by user for p in $(seq 1 5); do openssl rand -base64 48 | cut -c1-$PASS_LENGTH done |
Save the file and give executable permission using sudo chmod +x command and run the script.
Выход: