ユーザーの追加
sudo useradd -g member m-hiyama がうまくいかない。
[hiyama@microapplications ~]$ sudo useradd -g member m-hiyama
hiyama@microapplications Password:
sudo: useradd: command not found
[hiyama@microapplications ~]$
hiyamaからsuしてみると:
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/python/bin:/usr/bin:/bin:/usr/local/bin:/home/hiyama/bin
なんかパスが足りないみたいな。
[hiyama@microapplications ~]$ su -
Password:
Script started, file is /root/log/root_20100122-10:37:54.log[root@microapplications ~ 10:37:54]
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin[root@microapplications ~ 10:38:01]
# which useradd
/usr/sbin/useradd[root@microapplications ~ 10:38:04]
# useradd -g member m-hiyama[root@microapplications ~ 10:39:07]
# passwd m-hiyama
Changing password for user m-hiyama.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.[root@microapplications ~ 10:39:24]
#
これで、hiyama以外にm-hiyamaもできた。
hiyama@microapplications ~]$ su - m-hiyama
Password:
[m-hiyama@microapplications ~]$ ls -al
total 40
drwx------ 3 m-hiyama member 4096 Jan 22 10:40 .
drwxr-xr-x 18 root root 4096 Jan 22 10:40 ..
-w-r--r-- 1 m-hiyama member 24 Jan 22 10:40 .bash_logout
-w-r--r-- 1 m-hiyama member 191 Jan 22 10:40 .bash_profile
-w-r--r-- 1 m-hiyama member 124 Jan 22 10:40 .bashrc
-w-r--r-- 1 m-hiyama member 383 Jan 22 10:40 .emacs
-w-r--r-- 1 m-hiyama member 120 Jan 22 10:40 .gtkrc
drwxr-xr-x 2 m-hiyama member 4096 Jan 22 10:40 .xemacs
-w-r--r-- 1 m-hiyama member 658 Jan 22 10:40 .zshrc
[m-hiyama@microapplications ~]$
普通のユーザーのパスに/usr/sbinがないのね。PATH=/usr/sbin:$PATH; sudo ... とすればいいのか。どうもそうらしい。