yangyangstation 发表于 2009-12-31 11:10:48

加入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的信息提示,这是否正常,附件

fandy 发表于 2010-01-14 10:07:42

在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

这样不就可以啦!

kingwaycai 发表于 2010-03-03 16:41:21

more /usr/share/doc/pam-0.99.6.2/txts/README.pam_mkhomedir
页: [1]
查看完整版本: 加入ad后每个用户如何自动创建home目录?