0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Linuxにユーザを追加する手順

Posted at

はじめに

  • 基本的な作業だけなら非常に簡単
  • だが毎回忘れるので、流れを書いておこうと思った

ユーザアカウントの追加

流れは以下の通り:

  1. ユーザ作成:sudo useradd -m [ユーザ名]1
  2. ユーザが作られているか確認:ls /home
  3. パスワード初期設定:sudo passwd [ユーザ名]
  4. 必要に応じてグループを追加(次章)
  5. 新規アカウント発行者に連絡
    • アカウント発行者に、接続先サーバホスト名(サーバIP), ユーザ名, 初期パスワードを伝える
    • アカウント発行者に、接続時にpasswdコマンドで初期パスワードを変更するように伝える

グループの追加

sudoとかdockerとかのグループを追加することが多い。
流れは以下の通り:

  1. グループが追加されていないことを確認:id [ユーザ名]
  2. グループを追加:usermod -aG [グループ名] [ユーザ名]
  3. グループが追加されたことを確認:id [ユーザ名]

おわりに

  • サーバ管理の初歩でした
  • そのうち追記するかも
  1. オプション-mをつけることでホームディレクトリも作る。これが無いとユーザが初回ログインするまでホームディレクトリが作られないので、ユーザを追加したかどうかの確認をls /homeだけで済ませられない

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?