- Четыре простых способа сгенерировать сильный пароль в Linux
- 1. Создание надежного пароля в Linux с помощью OpenSSL
- 2. Создание надежного пароля в Linux с помощью Pwgenpwgen
- 3. Создание надежного пароля в Linux с помощью GPG
- 4. Создание надежного пароля в Linux с помощью Perl
- pwgen | Генератор паролей в Linux
- Синтаксис
- Дополнительно
- 5 Useful Password Generators For Linux
- Generate secure password in Linux with these tools
- 1. Pwgen
- 2. xkcdpass
- 3. Diceware
- 4. Revelation
- 5. KeepassX
- Best practices and tips for having strong passwords and security
Четыре простых способа сгенерировать сильный пароль в Linux
Оригинал: 4 Easy Ways To Generate A Strong Password In Linux
Автор: SK
Дата публикации: 4 ноября 2016 года
Перевод: А. Кривошей
Дата перевода: октябрь 2017 г.
Во всех публикациях о компьютерной безопасности всегда подчеркивается необходимость использования сильных паролей. Вы можете задаться вопросом, как выглядит надежный пароль и как его создать. Мы предлагаем рассмотреть 4 простых способа генерации надежного пароля в Linux. Конечно, есть много бесплатных инструментов и способов решения этой задачи, однако я считаю, что предлагаемые нами методы наиболее просты и понятны. Давайте начнем.
1. Создание надежного пароля в Linux с помощью OpenSSL
OpenSSL доступен для всех Unix-подобных систем, Solaris, Mac OS X и Windows.
Чтобы создать случайный пароль с помощью OpenSSL, запустите свой терминал и выполните следующую команду:
Здесь строка ‘-base64’ гарантирует, что пароль можно будет набрать на клавиатуре.
Вышеприведенная команда генерирует случайный и надежный пароль длиной 14 символов. Помните, что всегда рекомендуется генерировать пароль длиной не менее 14 символов. Конечно, с помощью openssl вы можете генерировать пароль любой длины.
Более детально применение openssl можно изучить, прочитав man-страницу:
2. Создание надежного пароля в Linux с помощью Pwgenpwgen
Pwgenpwgen — простая, но полезная утилита командной строки для генерации случайных и надежных паролей в считанные секунды. Он создает безопасные пароли, которые легко запомнить человеку. Pwgenpwgen доступен в большинстве Unix-подобных операционных систем.
Чтобы установить pwgen в системах на основе Debian, выполните команду:
В системах на базе RPM:
В системах на базе Arch:
После установки pwgen создать случайный и надежный пароль длиной 14 букв можно с помощью команды:
Приведенная выше команда создаст только один пароль длиной 14 символов. Чтобы создать 2 разных пароля длиной 14 символов, выполните:
Чтобы собрать 100 разных (не обязательно) паролей длиной 14 символов, выполните:
Чтобы включить как минимум 1 число в пароль:
Еще несколько полезных опций команды pwgen:
-c или —capitalize (включить в пароль хотя бы одну заглавную букву)
-A или —no-capitalize (не включать в пароль заглавные буквы)
-n или —numerals (включить в пароль хотя бы одно число)
-0 или —no-numerals (не включать в пароль цифры)
-y или —symbols (включить в пароль по крайней мере один специальный символ)
-s или -secure (генерировать полностью случайные пароли)
-B или — ambiguous (не включать в пароль двусмысленные символы)
-h или —help (вывести справку)
-H или —sha1 = path/to/file [#seed] (использовать хэш sha1 заданного файла в качестве случайного генератора)
-C (печатать сгенерированные пароли в столбцах)
-1 (не печатать сгенерированные пароли в столбцах)
-v или —no-vowels (не используйте гласные, чтобы избежать случайных неприятных слов)
3. Создание надежного пароля в Linux с помощью GPG
GPG (GnuPG или GNU Privacy Guard), это бесплатная утилита командной строки и замена криптографического программного обеспечения Symantec PGP. Он доступен для Unix-подобных операционных систем, Microsoft Windows и Android.
Чтобы создать случайный и надежный пароль длиной 14 символов с помощью GPG, выполните следующую команду из терминала:
Вышеприведенная команда создаст безопасный, случайный и сильный пароль.
4. Создание надежного пароля в Linux с помощью Perl
Perl доступен в репозиториях большинства дистрибутива Linux. Установите его с помощью диспетчера пакетов.
Например, для установки Perl на системах на основе Debian:
Чтобы установить Perl в системах на основе RPM, выполните:
В системах на базе Arch:
После установки Perl создайте файл:
Добавьте в него следующее содержимое.
Сохраните и закройте файл.
Теперь перейдите в папку, где вы сохранили файл, и выполните следующую команду:
Замените password.pl именем своего файла.
Примечание: я не смог найти оригинального автора этого скрипта. Если кто-либо знает имя автора, пожалуйста, дайте мне знать в комментариях. Я добавлю имя автора в статью.
Обратите внимание, что вы должны запомнить или сохранить созданные вами пароли в безопасном месте. Я рекомендую вам запомнить пароль и удалить его из системы. Это намного безопасней в случае, если ваша система будет скомпрометирована.
Источник
Как много времени потрачено на жизнь!
pwgen | Генератор паролей в Linux
17.07.09 13:52 / Обновлено 28.08.11 02:11 | Версия для печати | Linux | Программы |
Придумывать пароли — сложная творческая задача, особенно когда надо раздать пароли нескольким десяткам человек, а фантазии хватает только на «123qwe».
Поэтому лучше поручить эту задачу программе.
В дебианоподобных системах (в том числе и в Убунте. В других системах по-другому, но это сами разберётесь) делаем в консоли от имени суперпользователя:
aptitude install pwgen
Этим мы установим программу pwgen — консольный генератор паролей в Linux.
pwgen был написан для создания паролей сложных для подбора, но лёгких для запоминания человеком. Заострю на этом внимание: по умолчанию программа генерирует пароли, которые человек сможет потом легко запомнить! Это гарантирует (ну почти) то, что пользователь не прилепит этот пароль на монитор и не вставит на клочке бумажки в клавиатуру. А ещё pwgen имеет множество интересных настроек и предельно прост в употреблении.
Синтаксис
pwgen [ключи] [длина_пароля] [количество_паролей]
Ключ | Описание | Включить в пароль хотя бы одну большую букву. | Не использовать большие буквы при создании пароля. |
---|---|
Включить в пароль хотя бы одну цифру. | Не использовать цифры при создании пароля. | Включить в пароль хотя бы один специальный символ. | Создать абсолютно хаотичный пароль (не учитывать лёгкость в запоминании). | Не включать в пароль символы, которые можно перепутать (например, большая «O» и цифра «0»). Как написано в справке программы, этот ключ может использоваться людьми с плохим зрением, но в общем случае — не рекомендуется. | Вывести справку. Более полная справка доступна, как обычно, по man pwgen. | Использовать хэш sha1 заданного файла как генератор произвольных знаков. Пароли, сгенерированные таким методом, не будут совсем уж произвольными. Запомнив файл (и опциональный сид), можно восстановить пароль или серию паролей. Иногда это может быть полезно. |
Вывод сгенерированных паролей несколькими столбиками. | |
Вывод сгенерированных паролей одним столбцом. | Не использовать гласные буквы (или числа, которые могут быть приняты за гласные), чтобы случайно не получить матерное слово. Понятно, что пароли создаются на латинице, поэтому впечатлительным русским людям, не знающим иностранных языков, можно не волноваться. С другой стороны, транслит никто не отменял. |
Дополнительно
Ключи можно объединять. Например, если мы хотим создать пароль с цифрами, большими буквами и специальными символами, можно ввести:
Если ключ требует параметра, он должен стоять либо отдельно, либо на последнем месте:
длина_пароля задаёт длину паролей в символах, количество_паролей, как ни удивительно, количество паролей.
По умолчанию pwgen выдаёт полный экран восьмисимвольных паролей, с цифрами и большими буквами, навроде этого:
$ pwgen
yi0wohXa Ohw9Uboo ki7vooPh oi7roo5O Eghie3ai sheiHu7o ciiH8cae Bainou3O
OhChee5u Noo1ohku oHee7ONg ohY6eagh jaeShii1 vai0Phae aeK6Uegh EeGh3pai
uYoa9eig quooLie2 wa1aiSho eiZoop0G eiPh6vei Aizon4ya Aewaek1E OR9Pei7U
phee2ahK pai7aeNo do1booHi aiJah3Sh AQu8iaNg reim6Oog Eech2ooJ taCh8gee
quaeYie1 Thaut3Yi iC5nooch ah0yohKe ais6Eeva uut3gieT eiyo7Xee Iu4eisie
iJaca7Yu ieZ8hu6r aeW7Oola seeco9Ah ahcaeZ5s eeVei2So ePh5dua5 vohPee0O
ohRua8ro Sie5phei Fuyaena2 Ohchoo0e eecahSh4 Ov8bu2ie Ahb8ooW5 noh6Aese
ohRoo5sh tho9Otha Quaefoo1 quie9Ush Eer1Eove johkoo4N ve8aiTii quoF1Eef
EeZ2Baht eiy9lo8E ya8Eirua soRaequ8 eoPe9aaR jaebaeG5 dai6wahX aihahR4s
aQu6ohXo OopheF4T Pulohw0a Wae6aeth pi1Jotie uThahr1i eiTh0kai KeiZ9voh
wah2aiWa Ohth8On2 aiK1asee hiQu1ahr dai1Phei Yainaep1 che9eeTh Olahgh9i
eish7IeR aeb6Poe6 Uopae8ei Ciu5aeng bam8ohBo Thoh0qua ohKah9pa bieL1quu
ahPhieY6 OoHah4Ve Cae0phei Hoo6oogh ahW6doh6 ua0ieRoh eiH1WaQu wath2Wie
eixi6He2 Shohs4oh pui9oSie fee4Eb2E BaTheib2 choosh6D OoneM9ye hoQuie3u
eev4Xie7 Bae3Aevo Otaari2y Ibeem7ju la8En9sh WuPa2uyu OoShiX6i Xie3ex3X
Thee0ish xec5aeSi weebi1eX Fuwie7fu Cho1quaB Feep5ohz Baif4Oos Veuy6zuT
neiwee5I aiTeilu4 ahPheit1 iaZ8zuad Eafi8Buo pez3Quai oono0Phe voh6Ooch
aij0jaeK Jahta2ah aeTh6ohn ohMeeri2 Oop0use7 ief4lieH thee7eeB EiDov9ah
zahj4Usa ee7ae1Ja eitho9Ce ez1Bee9a Uhei9phe Iu4yai8a chaeG7za FooBe9ee
Ei9eisoh zeiL1ieG paiy5aeH Ouha8Ahr aeR8Hoop Nait0AhH weeMe6ci tuaP2aeg
или выдаёт единственный пароль (если стоит -1).
Количество паролей можно, также, задать дополнительным ключом:
-N или —num-passwords = количество_паролей
This version of pwgen was written by Theodore Ts’o . It is modelled after a program originally written by Brandon S. Allbery, and then later extensively modified by Olaf Titz, Jim Lynch, and others. It was rewritten from scratch by Theodore Ts’o because the original program was somewhat of a hack, and thus hard to maintain, and because the licensing status of the program was unclear.
Источник
5 Useful Password Generators For Linux
Last updated November 20, 2019 By Shirish 3 Comments
I am not going to discuss why you need strong passwords. It is an open secret that strong passwords keep you relatively safer.
Generating strong passwords is something you can do on your own but putting all the combination of lower and upper cases, numbers, symbols can be a tiresome work.
But you need not worry. Linux has got you covered. You can either use a password manager in Linux for managing your passwords or simply user password generating tools.
Let me share some of the best password generators for Linux that will ease the task for you.
Generate secure password in Linux with these tools
Most of the password generation tool discussed here are command line tools. Don’t worry, I have not forgotten readers who prefer GUI. This list of password generators for Linux covers both kinds of tools.
1. Pwgen
Now while making truly random passwords is easy if you have the right tools, remembering them is hard. For e.g. my goto tool to generate a random password is pwgen. Let’s first install it –
generating random passwords with pwgen is easy, just run pwgen and it will generate a list of passwords for you.
While the above may same excessive, in today’s world, it’s probably a tool which is needed. The default though I find to be too simplistic for my usage and use-cases.
pwgen provides a number of options that you can view in the help menu.
But if you want to take my advice, use the command to generate passwords in the following manner.
Just try it and you will see the results. The only way you can learn the tool, any tool for that matter is to play with it.
Related Post: Learn how to change user password in Ubuntu and other Linux distributions.
2. xkcdpass
I am hopeful and sure that most technology users might have heard and used xkcd by now. As it states right on the top it is”A webcomic of romance, sarcasm, math, and language.”- xkcd.com .
Now somewhere in end 2010, early 2011, xkcd.com published a webcomic strip –
That webcomic became an inspiration for the tool called xkcdpass. It entered Debian somewhere in 2015 so anybody running Debian squeeze and later are surely to have it. It tells about itself in its package description only – ” A flexible and scriptable password generator which generates strong passphrases, inspired by XKCD 936:” – giving homage to the webcomic which inspired its creation.
To use it, after installation one has to simply do –
Now what xkcdpass does is it has 12 dictionaries based on aspell work. You can read about the 12 dictionaries slightly long readme here.
xkcdpass by default uses dict2 and dict6 of the wordlist for their unique characteristics. Now while I’m not in a position to share whether it’s good choice of words or not, it’s an option that could and should be used, it can be combined with output of pwgen to have unique passwords as well. You can also use the first letter of each word of the passphrase to get a password which is easily memorable as well.
Whether it will be successful or not solely relies on the attacker’s skill and determination. For the casual brute-force attacks as shared above, the combination might be somewhat of a better choice.
3. Diceware
Another contendor for good memorable password generation is diceware. It also can be installed as –
Now by default Diceware strings two or more words together to produce a string, something like this –
diceware comes with its own worldlist, it has two worldlists, one is plain english words and the other one comes from EFF. Those who don’t know EFF, it is an organization which works for individual privacy rights in digital domain among other things. So you can use it in two ways –
and the one from eff:
There is an outstanding bug to have some more eff lists which would make the package even more relevant in this heightened security scenario. Hopefully, it will be fixed soon so we have a better package.
4. Revelation
On the GUI side, the first tool I would share is Revelation. First install the package.
Revelation is an oldish tool as it entered Debian since 2004 but has kept up with changes. Revelation describes itself as a GNOME 2 password manager but it is more than that. First either run it from either the command-line interface (CLI) or take the icon from the menu. You would usually find it in Menu > Accessories > Revelation . Just drag the icon from the menu to either the desktop or the top/bottom or side panel whichever is good for you, double-click to see the interface. For terminal users, do it as
Once you do it in either of the above ways, you need to go to View > Password Generator to see the Password Generator in action –
Once you click on that it will give you random passwords depending upon the length of the letters needed in the password and whether you need punctuation or not as can be seen in the picture below.
Now this is good or bad enough depending on what your needs are.
5. KeepassX
The tool has been in Debian for over a decade as well, was introduced in 2006. You can install it in Debian and other downstream or/and derivative distributions by doing:
Keepassx describes itself as a Cross Platform Password Manager but its much more than that. It puts your password in a database (like Mozilla Firefox does with sqlite3) and also encrypts it either using AES or Twofish algorithims (similar to Mozilla Firefox as well.)
Now in Keepassx, there is no easy way to get to the password generator. The way is first make a database, then make a group and then make an entry, when making the entry you will see a small button say Gen. If you see the third line Repeat, you see blank space, the button next to the blnak space
Once you click on Gen, another window appears
The Generate button generates passwords for you depending on what options you choose. Just copy the password on your favorite text-editor to know what password was generated.
The biggest difference between the command-line tools (CLI) and the Graphical User Interface (GUI) tools is the CLI tools can be used in scripts. So they can be used for both users and web hosters who might want to offer password generation as a service along with other services.
Best practices and tips for having strong passwords and security
- No one tool or no one strategy is the answer to all kinds of attacks and there are many different types of attacks.
- If possible try to find services which don’t put a cookie or a password. Such services are rare but they are there. A good example would perhaps be duckduckgo.com
- One of the most important rule, don’t use the same password to all the sites. That is like having all locks in real life using the same key. You can very well understand the consequences of that.
- One of the most common ways that an attacker can attack you is by owning your ADSL modem/router. At the very least don’t leave it at ‘admin/admin’ for both user and password. Ideally, you should change both but if you don’t want to change user:admin at least change the password there.
- Lastly, read and research on your own – Being a web user, it is imperative that you read and research on your own. There are all kinds of tools and techniques being born every day, While it is next to impossible to learn and keep watch on all that is being claimed and shared, at least some barest knowledge is needed to survive in this web world.
Hope these password generation Linux tools and the tips helps you to be more secure. Have a safe time on the web.
Like what you read? Please share it with others.
Источник