WindowsでCenttOS 7準拠の暗号化パスワードを作成する

WindowsでCenttOS 7準拠の暗号化パスワードを作成する

crypt(3)bashスクリプトで次のコマンドを使用して新しいユーザーアカウントを作成するときに、リモートCentOS 7サーバーが正常に解決できる暗号化されたパスワードをWindows DevBoxで生成するにはどうすればよいですか?useradd

useradd -u 12345 -g users -d /home/username -s /bin/bash -p '$1$NNfXfoym$Eos.OG6sFMGE8U6ImwBqT1' username

テストの目的で、パスワードのプレーンテキストバージョンは次のようにする必要があるとします。Whirlpool_Sauna_Soap

man useradd私は次のようになります。-p

   -p, --password PASSWORD
       The encrypted password, as returned by crypt(3). The default is to
       disable the password.

       Note: This option is not recommended because the password (or
       encrypted password) will be visible by users listing the processes.

       You should make sure the password respects the system's password
       policy.

Windows DevBoxからリモートCentOS 7サーバーにログインするためにパテを使用しています。scpWindows DevBoxからリモートCentOS 7サーバーにスクリプトを含むファイルを転送し、SSH接続を介してスクリプトを実行したいと思います。

ベストアンサー1

また、次のユーザーを作成するためにスクリプトを使用しました。

useradd -u 12345 -g users -d /home/username -s /bin/bash -p '$(openssl passwd -1 Whirlpool_Sauna_Soap)' username

おすすめ記事