「ユーザの追加」の編集履歴(バックアップ)一覧はこちら
「ユーザの追加」(2007/07/14 (土) 14:46:39) の最新版変更点
追加された行は緑色になります。
削除された行は赤色になります。
**ユーザを追加する
ユーザを追加する場合はadduserコマンドを使うと便利。rootになりオプション無しでadduserを実行すると、adduserがユーザ名やパスワードを聞いてくるので、それに答えていけばユーザを作成出来る。
こんな感じ
># adduser
>Username: hogehoge
>Full name: hogehoge no fugafuga
>Uid (Leave empty for default):
>Login group [simamaru]: wheel
>Login group is wheel. Invite simamaru into other groups? []:
>Login class [default]:
>Shell (sh csh tcsh bash rbash zsh nologin) [sh]: zsh
>Home directory [/home/simamaru]:
>Use password-based authentication? [yes]: yes
>Use an empty password? (yes/no) [no]: no
>Use a random password? (yes/no) [no]: no
>Enter password:
>Enter password again:
>Lock out the account after creation? [no]:
>Username : simamaru
>Password : *****
>Full Name : sima to maru
>Uid : 1002
>Class :
>Groups : wheel 0
>Home : /home/simamaru
>Shell : /usr/local/bin/zsh
>Locked : no
>OK? (yes/no): yes
>adduser: INFO: Successfully added (simamaru) to the user database.
>adduser: INFO: Account (simamaru) is locked.
>Add another user? (yes/no):
>Goodbye!
>#
[Lock out the account after creation? ]と聞かれたところで[yes]とすると、一般ユーザからsimamaruへログインすることが出来なくなるようです。
UIDは、何も入力しない場合はシステムが一意な番号を振ってくれます。
対話形式じゃなくて、1行のコマンドでユーザを作成する場合はpwコマンドで
># ># pw useradd simamaru -d /home/simamaru -g wheel -s /usr/local/bin/zsh
のようにすることも可能。
ユーザを削除する場合はrmuserを使う。
># rmuser simamaru
>Matching password entry:
>
>simamaru:*:1002:0::0:0:hogehoge no fugafuga:/home/simamaru:/usr/local/bin/zsh
>
>Is this the entry you wish to remove? y
>Remove user's home directory (/home/simamaru)?
>Removing user (simamaru): mailspool home passwd.
*TODO
-login classってなんだ?
-/usr/sbin/adduserスクリプトを読んでみる。
*参考記事
[[Localeのセットアップ>http://docs.freebsd.org/doc/2.2.8-RELEASE/usr/share/doc/ja/handbook/handbook168.html]]
[[adduserコマンド>http://www.wakhok.ac.jp/~kanayama/summer/02/site/node190.html]]
[[adduser>http://www.jp.freebsd.org/cgi/mroff.cgi?subdir=man&lc=1&cmd=&man=adduser&dir=jpman-6.2.2%2Fman&sect=0]]
**ユーザを追加する
ユーザを追加する場合はadduserコマンドを使うと便利。rootになりオプション無しでadduserを実行すると、adduserがユーザ名やパスワードを聞いてくるので、それに答えていけばユーザを作成出来る。
こんな感じ
># adduser
>Username: hogehoge
>Full name: hogehoge no fugafuga
>Uid (Leave empty for default):
>Login group [simamaru]: wheel
>Login group is wheel. Invite simamaru into other groups? []:
>Login class [default]:
>Shell (sh csh tcsh bash rbash zsh nologin) [sh]: zsh
>Home directory [/home/simamaru]:
>Use password-based authentication? [yes]: yes
>Use an empty password? (yes/no) [no]: no
>Use a random password? (yes/no) [no]: no
>Enter password:
>Enter password again:
>Lock out the account after creation? [no]:
>Username : simamaru
>Password : *****
>Full Name : sima to maru
>Uid : 1002
>Class :
>Groups : wheel 0
>Home : /home/simamaru
>Shell : /usr/local/bin/zsh
>Locked : no
>OK? (yes/no): yes
>adduser: INFO: Successfully added (simamaru) to the user database.
>adduser: INFO: Account (simamaru) is locked.
>Add another user? (yes/no):
>Goodbye!
>#
[Lock out the account after creation? ]と聞かれたところで[yes]とすると、一般ユーザからsimamaruへログインすることが出来なくなるようです。
UIDは、何も入力しない場合はシステムが一意な番号を振ってくれます。Shellは/etc/shellsファイルの記載されているシェルを指定する。
対話形式じゃなくて、1行のコマンドでユーザを作成する場合はpwコマンドで
># ># pw useradd simamaru -d /home/simamaru -g wheel -s /usr/local/bin/zsh
のようにすることも可能。
ユーザを削除する場合はrmuserを使う。
># rmuser simamaru
>Matching password entry:
>
>simamaru:*:1002:0::0:0:hogehoge no fugafuga:/home/simamaru:/usr/local/bin/zsh
>
>Is this the entry you wish to remove? y
>Remove user's home directory (/home/simamaru)?
>Removing user (simamaru): mailspool home passwd.
*TODO
-login classってなんだ?
-/usr/sbin/adduserスクリプトを読んでみる。
*参考記事
[[Localeのセットアップ>http://docs.freebsd.org/doc/2.2.8-RELEASE/usr/share/doc/ja/handbook/handbook168.html]]
[[adduserコマンド>http://www.wakhok.ac.jp/~kanayama/summer/02/site/node190.html]]
[[adduser>http://www.jp.freebsd.org/cgi/mroff.cgi?subdir=man&lc=1&cmd=&man=adduser&dir=jpman-6.2.2%2Fman&sect=0]]