Create a password generator using shell scripting Last Updated : 19 Jul, 2019 Comments Improve Suggest changes Like Article Like Report Creating a strong password is often a time-consuming task and even after creating a good password by yourself it gets brute-forced by hackers. In this article, we will learn how to create a strong password which fulfills all requirements including symbols, capitals length etc using a simple shell script in 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. Python3 #!/bin/bash # this can be anything of your choice echo "Welcome to simple password generator" # ask the user how much long should be echo "please enter the length of the password" # read the input given by user and store in variable read 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. Output: Comment More infoAdvertise with us Next Article Create a password generator using shell scripting M Madhusudan_Soni Follow Improve Article Tags : Technical Scripter Linux-Unix Similar Reads Create multiple users using shell script in Linux In Linux, we create users for multiple purposes, so in Linux, it's very common to make new users depending on the tasks. So sometimes we need to create more than one user or multiple users. We can't do it one by one as it would be very time-consuming, so we can use automated scripts to make our task 3 min read Shell Script to Perform Database Operations In this article, we will be creating a shell script to perform various database operations. We will be using the MySQL database management system and the MySQL command-line client for our examples. However, the concepts and techniques discussed in this article can be applied to other database manage 5 min read Random password generator in C In this article, we will discuss how to generate a random password of a given length consists of any characters. Approach: The below-given program involves basic concepts like variables, data types, array, loop, etc.Follow the below steps to solve this problem:Take the length of the password and dec 2 min read Automated Recursive Encryption in a Directory Using Shell Script This script would encrypt file provided as an argument or a directory and its constituent files and sub-directories recursively. It would be very useful for automating the encryption of multiple files in a directory all together. How it works? If no arguments are given, throw an error and exit the p 3 min read How to Create a Shell Script in linux Shell is an interface of the operating system. It accepts commands from users and interprets them to the operating system. If you want to run a bunch of commands together, you can do so by creating a shell script. Shell scripts are very useful if you need to do a task routinely, like taking a backup 7 min read Shell Scripting - Creating a Binary file While working in Linux systems, we have used so many commands on a day-to-day basis. Most of the commands are in the binary format resides under /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, etc directories. As system administrators, we would have to write many shell scripts to do a few tasks or 4 min read How to pass arguments to shell script in crontab ? In this article, we will discuss how to schedule shell scripts in crontab and to pass necessary parameters as well. First, let's create a simple script that we will be scheduled to run every 2 minutes. The below is a simple script that calculates the sum of all parameters passed and prints them to S 2 min read eval vs source: For Executing Commands Within a Shell Script Shell scripting is a fundamental skill for anyone working with Unix-like operating systems, offering a powerful way to automate tasks and streamline workflows. Two key commands, "source" and "eval," play distinct roles in the realm of shell scripting. In this article, we delve into the core concepts 8 min read Shell Scripting - Rules for Naming Variable Name Variables are quite important in any script or program, so we need to understand what is the convention to name these variables. There are certain rules and standards to keep in mind while giving names to the variables in Shell scripting. In this article, we will discuss and list down all the rules 4 min read Implementing Directory Management using Shell Script Directory management constitutes the functions dealing with organization and maintenance of various directories. Directories usually contain files of any type, but this may vary between file systems. The content of a directory does not affect the directory object itself. Some of the directory functi 3 min read Like