#author("2019-04-15T03:23:27+00:00","Group2","Group2") #author("2019-04-15T03:24:07+00:00","Group2","Group2") [[hidekiwiki]] #html{{ <meta name="description" content="https://fukumoto-tech.serveblog.net/wiki/" /> <meta name="keywords" content="mkpasswd,yum,パスワード,ランダムパスワード,コマンド,英数字混在,複雑,やり方,方法,作成,CentOS" / <link rel="canonical" href="https://fukumoto-tech.serveblog.net/wiki/" /> <br> <a href="http://it.blogmura.com/linux/"><img src="http://it.blogmura.com/linux/img/linux80_15_darkgray_1.gif" width="80" height="15" border="0" alt="にほんブログ村 IT技術ブログ Linuxへ" /></a><br /><a href="http://it.blogmura.com/linux/">にほんブログ村</a> <a href="https://it.blogmura.com/linux/"><img src="https://it.blogmura.com/linux/img/linux80_15_darkgray_1.gif" width="80" height="15" border="0" alt="にほんブログ村 IT技術ブログ Linuxへ" /></a><br /><a href="https://it.blogmura.com/linux/">にほんブログ村</a> <!-- admax --> <script src="http://adm.shinobi.jp/s/1a0429ab1f292195e9a461469817a0ca"></script> <script src="https://adm.shinobi.jp/s/1a0429ab1f292195e9a461469817a0ca"></script> <!-- admax --> </html> }} CentOS7の環境下でも同一の手順となります。 **mkpasswdをインストールするには [#lcee814a] yum -y install expect と実行します。RPMForgeを常時有効化していない場合は yum -y --enablerepo=rpmforge install expect と実行します。 これで、ランダムなパスワードを生成してくれるmkpasswdのインストールは完了です。 **mkpasswdの使い方 [#m377388b] mkpasswdコマンドの使い方は mkpasswd -l 20 と実行すると20桁のランダムな文字列を生成します。 **インストール時の表記例 [#x4d2dc6e] [root@hoge ~]# yum -y install expect Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.tsukuba.wide.ad.jp * extras: ftp.tsukuba.wide.ad.jp * updates: ftp.tsukuba.wide.ad.jp Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package expect.x86_64 0:5.44.1.15-2.el6 will be installed --> Processing Dependency: libtcl8.5.so()(64bit) for package: expect-5.44.1.15- 2.el6.x86_64 --> Running transaction check ---> Package tcl.x86_64 1:8.5.7-6.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================== =============================================================================== =================== Package Arch Version Repository Size =============================================================================== =============================================================================== =================== Installing: expect x86_64 5.44.1.15-2.el6 base 256 k Installing for dependencies: tcl x86_64 1:8.5.7-6.el6 base 1.9 M Transaction Summary =============================================================================== =============================================================================== =================== Install 2 Package(s) Total download size: 2.2 M Installed size: 4.9 M Downloading Packages: (1/2): expect-5.44.1.15-2.el6.x86_64.rpm | 256 kB 00:00 (2/2): tcl-8.5.7-6.el6.x86_64.rpm | 1.9 MB 00:03 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- ------------------- Total 326 kB/s | 2.2 MB 00:06 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 1:tcl-8.5.7-6.el6.x86_64 1/2 Installing : expect-5.44.1.15-2.el6.x86_64 2/2 Installed: expect.x86_64 0:5.44.1.15-2.el6 Dependency Installed: tcl.x86_64 1:8.5.7-6.el6 Complete!