In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what are the methods of generating random passwords with Linux command line". In daily operation, I believe that many people have doubts about the method of generating random passwords with Linux command line. Xiaobian consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what is the method of generating random passwords with Linux command line"? Next, please follow the editor to study!
One of the great advantages of the Linux operating system is that you can do the same thing in hundreds of ways. For example, you can generate random passwords in dozens of ways. This article will introduce ten methods for generating random passwords.
These methods are collected from Command-Line Fu and tested on our own Linux PC machine. Some of these ten methods can also be run under Windows with Cygwin installed, especially the * method.
Generate a random password
For any of the following methods, you can simply modify the password to generate a specific length, or use only the first N bits of the output. I hope you are using a password manager similar to LastPass so that you don't have to remember these randomly generated passwords yourself.
1. This method uses the SHA algorithm to encrypt the date and output the first 32 characters of the result:
Date +% s | sha256sum | base64 | head-c 32; echo
two。 This approach uses the embedded / dev/urandom and filters out characters that are rarely used on a daily basis. Here, only the first 32 characters of the result are output:
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo; 3. 这种方法使用openssl的随机函数。如果你的系统也许没有安装openssl,你可以尝试其它九种方法或自己安装openssl。 openssl rand -base64 32 4. 这种方法类似于之前的urandom,但它是反向工作的。Bash的功能是非常强大的! tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1 5. 这种方法使用string命令,它从一个文件中输出可打印的字符串: strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo 6. 这是使用urandom的一个更简单的版本: < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6 7. 这种方法使用非常有用的dd命令: dd if=/dev/urandom bs=1 count=32 2>/ dev/null | base64-w 0 | rev | cut-b 2-| rev
8. You can even generate a password that can be entered with only the left hand:
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.