44
45

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Userの追加・削除(CentOS)

Last updated at Posted at 2017-04-09

Userの追加・削除を行うためには管理者権限が必要なので、suコマンドでrootになってから始める。
#Userの追加
useraddコマンドを使ってユーザーの追加。

$ useradd [username]
#[username]は追加したいユーザー名

###オプション

よく使うもの。

  • -d [dir] ログインディレクトリを設定
  • -g [gid] グループIDを設定
  • -m ホームディレクトリを作成
  • -u [uid] ユーザーIDを設定

$ useradd -d /home/downtown/hamada -g 123 -m -u 4567

passwdコマンドでパスワードを設定。

$ passwd [username]

#Userの削除
userdelコマンドでユーザーの削除。

$ userdel [username]

###オプション

  • -r ホームディレクトリも同時に削除
44
45
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
44
45

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?