加入ad后每個用戶如何自動創建home目錄?
samba3入域后如何自動創建home目錄?
系統是freebsd,已經安裝了pam_mkhomedir插件,但好像不會自動建立文件夾啊?
我的配置文件:
workgroup = abc
netbios name = MY-SAMBA-SERVER
wins server = ad.abc.com
os level = 33
security = domain
encrypt passwords = yes
password server = *
allow trusted domains = No
idmap config EXAMPLE:backend = rid
idmap config EXAMPLE:range = 500-100000000
idmap uid = 500-100000000
idmap gid = 500-100000000
template shell = /bin/sh
winbind use default domain = Yes
winbind enum users = No
winbind enum groups = No
winbind nested groups = Yes
comment = Home Directories
browseable = no
writeable = yes
comment = Public Stuff
path = /var/ftp/pub
valid users = @zixun
write list = @zixun, @ftpuser
vfs object = recycle
recycle:repository = .recycle/%U
recycle:keeptree = yes
recycle:touch = yes
recycle:versions = yes
recycle:exclude = *.tmp, *.TMP
comment = Backup
path = /backup
valid users = @zixun
write list = @zixun
whinfo -u 能夠看到用戶了,用zixun組的用戶能進pub和backup目錄,但home目錄無法進入
還有我的ttyv0終端經常有nmbd和winbind的信息提示,這是否正常,附件
《解決方案》
在SMB.CONF文件例子:
comment = Home Directories
path = /home/%U
writable = yes
browseable = no
valid users = %U
root preexec = /home/mkhome.sh %U %G
新建一個mkhome.sh內容如果:
#vi /home/mkhome.sh
#!/bin/bash
user=$1
group=$2
home=/home/$1
if [ ! -d $home ] ; then
mkdir -p $home
chown $user $home
chgrp $group $home
chmod 700 $home
fi
這樣不就可以啦!
《解決方案》
more /usr/share/doc/pam-0.99.6.2/txts/README.pam_mkhomedir