Cannot make 'username map' to work with Samba
I have configured Samba to work with our Win 2003 R2 PDC using AD. That all works fine.
However, because our existing Linux server has a lot of users already configured, and those user names also exist on other servers (and scripts dynamically pick up the user name)then I have a problem. The problem is this; the domain name for a user Fred Bloggs is bloggsf, but Fred has a Linux account (and home dir) for the name fredb.
I believe I should be able to use "username map", and smbusers to map bloggsf to fredb.
I have configured this in smb.conf,
username map = /etc/samba/smbusers
Then in smbusers, I have this;
fredb = bloggsf
But when I login as bloggsf, I am authenticated OK, but the system complains it cannot find a home dir of /home/EU/bloggsf. This is because I have not created one, because I want it to use /home/EU/fredb.
Note, I have configured a user locally thus;
fredb:x:501:501:FredBLocal:/home/EU/fredb:/bin/bash
I really hoped, and expected that "username map" would make bloggsf appear as user fredb once logged in, but it appears not. If I run 'id' from the command line, I am still very much bloggsf.
My smb.conf looks like this;
[global]
log level = 10
workgroup = EU
server string = sectest server
realm = EU.MYDOMAIN.LOCAL
log file = /var/log/samba/%m.log
max log size = 50
security = ADS
password server = MY-PDC.EU.MYDOMAIN.LOCAL
username map = /etc/samba/smbusers
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
idmap uid = 10000-20000
idmap gid = 10000-20000
template shell = /bin/bash
winbind use default domain = yes
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = no
writeable = yes
path = /home/%D/%u
valid users = %u
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
printable = yes
My smbusers file looks like this;
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin
nobody = guest pcguest smbguest
fredb = EU/bloggsf
I am also running windbindd, and have some PAM modules configured, which I believe is what I need to have done.
I am fairly new to this level of server admin, so can only assume that I have done everything correctly so far.
I am sure it is something simple that is missing, so if somebody could help me I would be most grateful.
Thanks in anticipation
|