-base64: ensures that the password format is user-friendly.Rand: OpenSSL function that generates a pseudo-random password.To generate secure passwords using OpenSSL rand function, execute this command in Terminal: $ openssl rand -base64 14 To install the rand function in OpenSSL, execute this command in Terminal: $ sudo apt install rand OpenSSL is pre-installed in most of the Linux distributions. Base 64 encoding uses “A–Z, a–z, 0–9, and /” characters only. If the output of rand function is fed to the base64 encoding, password format can be made more user-friendly. Just specify the byte length of the password you want to generate and OpenSSL will perform all the computation and generate password. Open SSL is a command-line utility whose rand function can be used for generating secure random passwords in a Linux system. When the search result appears, click on the Terminal icon to open it. Then in the search bar, type the keyword terminal. ![]() To open the command-line Terminal in Debian, go to the Activities tab in the top left corner of your desktop. Some of these tools are command-line based while some are based on GUI. We have run the commands and procedure discussed in this article on Debian 10 system. In this article, we will be discussing some tools in Linux through which you can generate such secure and strong passwords. Also, a password should not be based on common names and dictionary words. The common thinking is that a strong password must be of a minimum of 14 characters and contains lowercase letters, upper case letters, numbers, and symbols. The important point is to generate a password that is secure enough to rely on and that follows all the basic requirements of a strong password. Run the backup_home_dir.We all know the importance of a secure password in our system, services, online account, and other critical applications. The third task loops through the dir_contents.stdout_lines array and uses the Ansible copy module to copy each directory to the /tmp/ansible/ directory. This is the directory where the backup will be stored. The second task creates a new directory /tmp/ansible using the Ansible file module. The first task stores the contents of the /home/ansible directory (the directory I will be backing up) in the dir_contents variable using the Ansible register module. In this playbook, I will define three tasks. Once you are done, press X, followed by Y and, to save the backup_home_dir.yaml file. name : Backup home directory /home/ansible to /tmp/ansible name : Create a new directory /tmp/ansible name : Get home directory /home/ansible contents If you just want to print/access the password string (which is very likely), you may print/access the stdout property of the mypass variable in your playbook, as marked in the screenshot below. Same as stderr, but stderr separates the lines using newlines (\n) characters instead of arrays. Stderr_lines – An array containing each error output line of the command. Same as stdout, but stdout separates the lines using a newline (\n) characters instead of arrays. Stdout_lines – An array containing each output line of the command. This is the difference between the end and the start properties. ![]() Start – The date and time when the command began executing.Įnd – The date and time when the command finished executing.ĭelta – The time taken to run the command. Stderr – The error output of the command. The most important properties of each of the register variables are as follows:Ĭmd – The command that ran to generate the output. Well, the variable mypass is an object that contains some important properties. A password has also been generated.īut, why did the variable mypass print so many items? $ ansible-playbook playbooks/generate_pass.yamlĪs you can see, the playbook ran successfully.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |