|
|
| 行10: |
行10: |
| | * [[Linux ユーザーアカウントを調べる]] | | * [[Linux ユーザーアカウントを調べる]] |
| | * [[Linux ユーザーアカウントを作成する]] | | * [[Linux ユーザーアカウントを作成する]] |
| | + | * [[Linux ユーザーアカウントを削除する]] |
| | * [[Linux ユーザーアカウントのロックとアンロック]] | | * [[Linux ユーザーアカウントのロックとアンロック]] |
| | + | * [[Linux ユーザーアカウントのパスワードを設定する]] |
| | | | |
| − | == 使い方 ==
| |
| − |
| |
| − | ユーザの情報を調べます。
| |
| − |
| |
| − | ユーザが存在しない場合
| |
| − | <syntaxhighlight lang="bash">
| |
| − | $ id foo
| |
| − | id: foo: No such user
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | $ id foo
| |
| − | uid=503(foo) gid=503(foo) groups=503(foo)
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | ユーザを追加します。
| |
| − | <syntaxhighlight lang="bash">
| |
| − | $ sudo adduser foo
| |
| − | [sudo] password for bar:
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | アカウントの状態の確認
| |
| − |
| |
| − | <syntaxhighlight lang="bash">
| |
| − | $ sudo passwd -S foo
| |
| − | foo LK 2013-08-11 0 99999 7 -1 (Password locked.)
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − |
| |
| − | パスワードが未設定のアカウントを有効にしようとした場合、下記のメッセージが出力されます。
| |
| − | <syntaxhighlight lang="bash">
| |
| − | ]$ sudo passwd -u foo
| |
| − | Unlocking password for user foo.
| |
| − | passwd: Warning: unlocked password would be empty.
| |
| − | passwd: Unsafe operation (use -f to force)
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | -f オプションで、強制的にアンロックできます。
| |
| − | <syntaxhighlight lang="bash">
| |
| − | $ sudo passwd -f -u foo
| |
| − | Unlocking password for user foo.
| |
| − | passwd: Success
| |
| − | </syntaxhighlight>
| |
| − |
| |
| − | ユーザアカウントをロックします。
| |
| − | <syntaxhighlight lang="bash">
| |
| − | $ sudo passwd -l foo
| |
| − | Locking password for user foo.
| |
| − | passwd: Success
| |
| − | </syntaxhighlight>
| |
| | | | |
| | == 関連項目 == | | == 関連項目 == |