GNU/Linux >> Linux の 問題 >  >> Ubuntu

特定のUidでUbuntuをインストールしますか?

UIDを変更することで数えることができないほど多くの問題が発生しました。とてもイライラしているので、フォーマットして最初からやり直します。今回はインストールが欲しいです 最初のユーザーが使用するために、たとえばUID 1200を使用します。Ubuntuをインストールしてから、UIDを変更してすべての問題を作成したくありません。これらすべての問題を修正する方法がわかりません。それがフォーマットを行う理由です。私は確かに Ubuntuでその間違いを二度と行うことはありません。特定のUIDを使用してUbuntuをインストールしたいだけです。どうすればいいですか?

承認された回答:

方法1–特定のUIDを持つユーザーを作成するだけの場合

  1. Ubuntuを通常どおりインストールする
  2. Ubuntuにログイン
  3. ターミナルを開く
  4. ID 1200 sudo adduser -u 1200 <username>の新しいユーザーを作成します
  5. ユーザーが目的のIDで作成されたことを確認しますawk -F: '/\/home/ {printf "%s:%s\n",$1,$3}' /etc/passwd>
  6. 新しく作成したユーザーをsudoersグループに追加しますsudo adduser <username> sudo
  7. ログアウト
  8. 新しく作成したユーザーでログイン
  9. (オプション)古いユーザーを削除します

方法2–プレシードを使用したUbuntuの自動インストール

インストール時にUID範囲を定義できるようにするには、プレシードを使用してUbuntuのインストールを自動化する必要があります。これは基本的に


インストールの実行中に手動で回答を入力しなくても、インストールプロセス中に尋ねられた質問に対する回答を設定する方法
。これにより、ほとんどの
タイプのインストールを完全に自動化でき、通常のインストールでは利用できない
一部の機能も提供されます。

この投稿の一部として投稿するための広範な方法であるこの方法を使用すると、(他の多くのことの中でも)インストール時に作成されるアカウントを設定できます。例:

# Skip creation of a root account (normal user account will be able to
# use sudo). The default is false; preseed this to true if you want to set
# a root password.
#d-i passwd/root-login boolean false
# Alternatively, to skip creation of a normal user account.
#d-i passwd/make-user boolean false

# Root password, either in clear text
#d-i passwd/root-password password r00tme
#d-i passwd/root-password-again password r00tme
# or encrypted using an MD5 hash.
#d-i passwd/root-password-crypted password [MD5 hash]

# To create a normal user account.
#d-i passwd/user-fullname string Ubuntu User
#d-i passwd/username string ubuntu
# Normal user's password, either in clear text
#d-i passwd/user-password password insecure
#d-i passwd/user-password-again password insecure
# or encrypted using an MD5 hash.
#d-i passwd/user-password-crypted password [MD5 hash]
# Create the first user with the specified UID instead of the default.
#d-i passwd/user-uid string 1010
# The installer will warn about weak passwords. If you are sure you know
# what you're doing and want to override it, uncomment this.
#d-i user-setup/allow-password-weak boolean true

# The user account will be added to some standard initial groups. To
# override that, use this.
#d-i passwd/user-default-groups string audio cdrom video

# Set to true if you want to encrypt the first user's home directory.
d-i user-setup/encrypt-home boolean false

次の行に注意してください:

# Create the first user with the specified UID instead of the default.
d-i passwd/user-uid string 1010

自動インストールについて詳しく知りたい場合は、インターネットに役立つ情報のソースがいくつかあります。これは現在の公式ドキュメントです:

関連:iwlwifiドライバーをロードする方法??

https://help.ubuntu.com/lts/installation-guide/armhf/apbs01.html


Ubuntu
  1. Ubuntu18.04または20.04にHadoopをインストールする方法

  2. UbuntuにApacheZooKeeperをインストールする方法

  3. Ubuntu 18.04にApacheを使用してphpMyAdminをインストールします-ステップバイステップのプロセス?

  1. Ubuntu18.04でApacheを使用してphpMyAdminをインストールして保護する方法

  2. Ubuntu18.04にNginxを使用してphpMyAdminをインストールする方法

  3. Ubuntu16.04にPostgreSQLとNginxを使用してMattermostをインストールする方法

  1. Ubuntu16.04にNginxでMediaWikiをインストールする方法

  2. Ubuntu15.10にNginxを使用してMagentoをインストールする方法

  3. Ubuntu15.10にNginxでMailpileをインストールする方法