「Linux ユーザーアカウント」の版間の差分

提供: セキュリティ
移動: 案内検索
 
(同じ利用者による、間の1版が非表示)
行1: 行1:
<!--
 
vim: filetype=mediawiki
 
-->
 
 
このページは、[[Linux]] のユーザーアカウントに関連する情報です。
 
このページは、[[Linux]] のユーザーアカウントに関連する情報です。
  
行7: 行4:
  
 
== 概要 ==
 
== 概要 ==
 
 
* [[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>
+
 
+
 
== 関連項目 ==
 
== 関連項目 ==
 
 
* [[Linux]]
 
* [[Linux]]
* [[id]]
+
* id
* [[adduser]]
+
* adduser
* [[passwd]]
+
* passwd
 +
<!-- vim: filetype=mediawiki
 +
-->

2015年9月22日 (火) 21:20時点における最新版

このページは、Linux のユーザーアカウントに関連する情報です。

概要

関連項目