文書の過去の版を表示しています。
podman ローカル プライベート レジストリの構築
インストール
$ sudo dnf install -y podman httpd-tools
メタデータの期限切れの最終確認: 1:14:37 前の 2024年03月19日 06時13分34秒 に実施しました。 パッケージ podman-5:4.9.3-1.fc39.x86_64 は既にインストールされています。 パッケージ httpd-tools-2.4.58-1.fc39.x86_64 は既にインストールされています。 依存関係が解決しました。 行うべきことはありません。 完了しました!
レジストリ構築
レジストリ用のディレクトリを作成🤔
$ sudo mkdir -p /var/lib/registry/{auth,certs,data} && sudo ls -al /var/lib/registry
合計 0 drwxr-xr-x 1 root root 26 3月 19 07:36 . drwxr-xr-x. 1 root root 1042 3月 19 07:36 .. drwxr-xr-x 1 root root 0 3月 19 07:36 auth drwxr-xr-x 1 root root 0 3月 19 07:36 certs drwxr-xr-x 1 root root 0 3月 19 07:36 data
レジストリ認証用の htpasswd ファイルを作成🤔
$ sudo htpasswd -cB /var/lib/registry/auth/htpasswd tomoyan
New password: password 入力 Re-type new password: 確認 password 入力 Adding password for user tomoyan
$ sudo bat -n /var/lib/registry/auth/htpasswd
1 tomoyan:$2y$05$MO8AFjpgWM5mVvYxbDpeIeWntMr0jxkkQ6krWEZ04n39RA73F2PWC
htpasswd の使い方 🤤
$ htpasswd
Usage: htpasswd [-cimBdpsDv] [-C cost] passwordfile username htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password htpasswd -n[imBdps] [-C cost] username htpasswd -nb[mBdps] [-C cost] username password -c Create a new file. -n Don't update file; display results on stdout. -b Use the password from the command line rather than prompting for it. -i Read password from stdin without verification (for script usage). -m Force MD5 encryption of the password (default). -2 Force SHA-256 crypt() hash of the password (very secure). -5 Force SHA-512 crypt() hash of the password (very secure). -B Force bcrypt encryption of the password (very secure). -C Set the computing time used for the bcrypt algorithm (higher is more secure but slower, default: 5, valid: 4 to 17). -r Set the number of rounds used for the SHA-256, SHA-512 algorithms (higher is more secure but slower, default: 5000). -d Force CRYPT encryption of the password (8 chars max, insecure). -s Force SHA-1 encryption of the password (insecure). -p Do not encrypt the password (plaintext, insecure). -D Delete the specified user. -v Verify password for the specified user. On other systems than Windows and NetWare the '-p' flag will probably not work. The SHA-1 algorithm does not use a salt and is less secure than the MD5 algorithm.
使用法: htpasswd [-cimBdpsDv] [-C cost] passwordfile username htpasswd -b[cmBdpsDv] [-C cost] passwordfile username password htpasswd -n[imBdps] [-C cost] username htpasswd -nb[mBdps] [-C cost] username password -c 新しいファイルを作成します。 -n ファイルを更新しません。結果を標準出力に表示します。 -b パスワードを要求するのではなく、コマンドラインからパスワードを使用します。 -i 検証なしで標準入力からパスワードを読み取ります (スクリプト使用のため)。 -m パスワードの MD5 暗号化を強制します (デフォルト)。 -2 パスワードの SHA-256 crypt() ハッシュを強制します (非常に安全)。 -5 パスワードの SHA-512 crypt() ハッシュを強制します (非常に安全)。 -B パスワードの bcrypt 暗号化を強制します (非常に安全です)。 -C bcrypt アルゴリズムに使用される計算時間を設定します。 (値が高いほど安全ですが速度は遅くなります、デフォルト: 5、有効: 4 ~ 17)。 -r SHA-256、SHA-512 アルゴリズムに使用されるラウンド数を設定します。 (値が高いほど安全性は高くなりますが、速度は遅くなります。デフォルト: 5000)。 -d パスワードの CRYPT 暗号化を強制します (最大 8 文字、安全ではありません)。 -s パスワードの SHA-1 暗号化を強制します (安全ではありません)。 -p パスワードを暗号化しません (平文、安全ではありません)。 -D 指定したユーザーを削除します。 -v 指定されたユーザーのパスワードを確認します。 Windows および NetWare 以外のシステムでは、'-p' はおそらくフラグは機能しないでしょう。 SHA-1 アルゴリズムはソルトを使用しないため、MD5 アルゴリズムよりも安全性が低くなります。