ubuntu samba服务器多用户配置
来源:岁月联盟
时间:2012-04-11
ubuntu samba服务器多用户配置 在/home/下有多个用户目录A、B...,现通过samba共享,要求A用户对A用户组目录具有root权限,对其他目录具有读权限,B用户对B目录具有root权限,对其他目录只读。并在登陆各个目录时要求输入samba用户名和密码。已在10.04上通过。 www.2cto.com 1、安装sambasudo apt-get install sambasudo apt-get install smbfs 2、添加系统用户 sudo adduser A sudo adduser Bsudo adduser xx (用户名) 注意不要用sudo uaeradd xxsudo adduser xxAdding user `xx' ...Adding new group `xx' (1008) ...Adding new user `xx' (1008) with group `xx' ...Creating home directory `/home/xx' ...Copying files from `/etc/skel' ...Enter new UNIX password: 输入该用户的登陆密码Retype new UNIX password: 确认密码passwd: password updated successfullyChanging the user information for dengyxEnter the new value, or press ENTER for the default Full Name []: 回车 Room Number []: 回车 Work Phone []: 回车 Home Phone []: 回车 Other []: 回车Is the information correct? [Y/n] y 执行完之后会在/home/目录下创建用户组,用户和相应用户目录。 3、修改/etc/samba/smb.cof[global] workgroup = WORKGROUP server string = %h server (Samba, Ubuntu) dns proxy = no www.2cto.com log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d security = user encrypt passwords = true passdb backend = tdbsam obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter/snew/s*/spassword:* %n/n *Retype/snew/s*/spassword:* %n/n *password/supdated/ssuccessfully* . pam password change = yes map to guest = bad user usershare allow guests = yes [homes]comment = homevalid user = %Swritable=yesbrowseable=nocreate mode = 0664directory mode = 0775 www.2cto.com [A]path=/home/Aavailable=yesbrowseable=yespublic=noalid user = Awritable=yes [B]path=/home/Bavailable=yesbrowseable=yespublic=noalid user = Bwritable=yes 4,添加samba用户和设置密码。 sudo smbpasswd -a A 会提示输入密码,输入两次ok,会同时建立samba用户和密码 sudo smbpasswd -a B 5、保存配置,重启samba服务 sudo /etc/samba/smbd restart 注意:有时候你输入用户和密码后会提示: 不允许一个用户使用一个以上用户名与一个服务器或共享资源的多重连接。中断与此服务器或共享资源的连接,然后在试一次... 请在windows 下面,执行如下命令:运行-》cmd -》net use * /del /y 作者 lbmygf
上一篇:ubuntu自动挂载指定设备