Hello,
I am trying to get permissions working properly on a RHEL 4 server for a mounted cifs share from a W2003 Storage Server.
The setup is as follows:
We are using an Windows 2003 R2 server for Active Directory user authentication. The AD server has Identity Management for Unix installed, and certain users and groups have been given Unix properties (UID/GID, etc) to allow identification of users across both Linux and Windows computers.
The second server involved is a RHEL 4 server. I set up LDAP/Kreberos user authentication per
this article. I edited the /etc/pam.d/samba file instead of system-auth, however, because we do not want network users to be able to log in to the server. In initial tests, editing the system-auth file allowed network users to log in, so I know local authentication of A.D. users is working. I can also do a getent group and getent passwd and the A.D. users with Unix properties are in the lists.
The third server is a Windows 2003 R2 Storage Server being used as a NAS. PC clients connect directly to the NAS via standard Windows shares without a problem.
This is where it gets tricky - I am trying to mount the share via cifs from the RHEL server using the A.D. Administrator user account so that it can manage permissions and ownership of files on the share by A.D. users. We tried NFS shares, which works without any problems by using username mapping (for root access) on the storage server coupled with the Active Directory user mapping; however, we ran into poor language support between the RHEL server and the Storage Server when languages other than English are used for filenames.
The Problem:
I can mount the share via cifs and access files without any problem, but when I perform an 'ls -l' command, all files are listed as owned by user "root", group "root" even if an A.D. user with Unix properties owns the file.
If I want a file to be owned by A.D. user 'John' I can do "chown John:MyGroup theFile.txt". Subsequently, doing 'ls -l' will list the file as owned by "John", group "MyGroup". HOWEVER, looking at the file on the storage server reveals that the windows file permissions on the file have not actually changed at all. As a result, the user who
should own the file does not and a PC client logged in as the appropriate users cannot access the file with the proper permissions.
Other Notes:
NFS works, but as mentioned above, this causes problems for us when languages other than English are used for file and folder names. NFS user mapping appears to work because the W3k storage server is doing the heavy lifting of RID->UID/GID mapping of file permissions, rather than the RHEL server. Hence when the share is mounted via cifs on the RHEL server, it does not recognize the Windows file permissions and cannot set permissions correctly. That is my impression so far, at least. I suspect there is something wrong with my PAM or Samba configuration that is preventing A.D. permissions from working correctly on the cifs share.
So, I need to be able to properly identify and assign file ownership by A.D. users using a cifs share on the RHEL server.
Applicable Info
/etc/hosts
Code:
127.0.0.1 localhost localhost.localdomain
192.168.0.10 DomainCont DomainCont.Domain.local
192.168.0.15 RHELServer RHELServer.RHELComputer
*If I use the FQDN for the RHEL Server in the hosts file, the 'net ads join' command stalls.
/etc/krb5.conf
Code:
[logging]
default = FILE:/var/log/krb5libs.log
kdc = FILE:/var/log/krb5kdc.log
admin_server = FILE:/var/log/kadmind.log
[libdefaults]
default_realm = DOMAIN.LOCAL
dns_lookup_realm = true
dns_lookup_kdc = true
[realms]
DOMAIN.LOCAL = {
kdc = domaincont.domain.local:88
admin_server = domaincont.domain.local:749
kpasswd_server = domaincont.domain.local:464
kpasswd_protocol = SET_CHANGE
default_domain = true
}
[domain_realm]
.domain.local = DOMAIN.LOCAL
domain.local = DOMAIN.LOCAL
[kdc]
profile = /var/kerberos/krb5kdc/kdc.conf
[appdefaults]
pam = {
debug = false
ticket_lifetime = 36000
renew_lifetime = 36000
forwardable = true
krb4_convert = false
}
/etc/krb.conf
Code:
DOMAIN.LOCAL
DOMAIN.LOCAL domaincont.domain.local:88
DOMAIN.LOCAL domaincont.domain.local:749 admin server
SICS.SE kerberos.sics.se admin server
[...]
/etc/krb.realms
Code:
domain.local DOMAIN.LOCAL
.domain.local DOMAIN.LOCAL
sics.se SICS.SE
[...]
/etc/ldap.conf
Code:
host 192.168.0.10
base dc=domain,dc=local
uri ldap://domaincont.domain.local/
binddn ldap@domain.local
bindpw MyPassword
scope sub
timelimit 120
bind_timelimit 120
idle_timelimit 3600
nss_initgroups_ignoreusers root,ldap
referrals no
ssl no
nss_base_passwd dc=domain,dc=local?sub
nss_base_shadow dc=domain,dc=local?sub
nss_base_group dc=domain,dc=local?sub?&(objectCategory=group)(gidnumber=*)
nss_map_objectclass posixAccount user
nss_map_objectclass shadowAccount user
nss_map_objectclass posixGroup group
nss_map_attribute uid sAMAccountName
nss_map_attribute homeDirectory unixHomeDirectory
nss_map_attribute gecos cn
nss_map_attribute shadowLastChange pwdLastSet
nss_map_attribute uniqueMember member
pam_login_attribute sAMAccountName
pam_filter objectclass=User
pam_password ad
/etc/sys-config/network
Code:
NETWORKING=yes
HOSTNAME=RHELServer
/etc/nsswitch.conf
Code:
[...]
passwd: files ldap winbind
shadow: files ldap winbind
group: files ldap winbind
[...]
/etc/pam.d/samba
Code:
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_unix.so nullok try_first_pass
auth requisite pam_succeed_if.so uid >= 10000 quiet
auth sufficient pam_krb5.so use_first_pass
auth required pam_deny.so
account required pam_unix.so broken_shadow
account sufficient pam_localuser.so
account sufficient pam_succeed_if.so uid < 10000 quiet
account [default=bad success=ok user_unknown=ignore] pam_krb5.so
account required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3
password sufficient pam_unix.so md5 shadow nis nullok try_first_pass use_authtok
password sufficient pam_krb5.so use_authtok
password required pam_deny.so
session optional pam_keyinit.so revoke
session required pam_mkhomedir.so skel=/etc/skel umask=0022
session required pam_limits.so
session [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session required pam_unix.so
session optional pam_krb5.so
*A bit odd that we make the home directory for a user when they connect to the RHEL server via Samba, but there is a reason behind it.
/etc/samba/smb.conf
Code:
[global]
unix charset = LOCALE
workgroup = DOMAIN
netbios name = RHELServer
realm = DOMAIN.LOCAL
server string = RHEL Server
security = ADS
use kerberos keytab = Yes
idmap backend = ad
ldap idmap suffix = dc=domain,dc=local
ldap admin dn = cn=ldap,cn=Users,dc=domain,dc=local
ldap suffix = dc=domain,dc=local
idmap uid = 100000-200000
idmap gid = 100000-200000
log file = /var/log/samba/%m.log
log level = 1
syslog = 0
max log size = 50
printcap name = CUPS
winbind use default domain = yes
winbind nested groups = Yes
obey pam restrictions = Yes
template shell = /bin/bash
printing = cups
show add printer wizard = no
os level = 0
preferred master = no
local master = no
domain master = no
server signing = disabled
server schannel = auto
client schannel = auto
dead time = 15
# Set to RAID stripe size
write cache size = 65535
# -- did that slow it down?
max xmit = 65535
logon path =
logon drive = M:
logon home = \\%L\media\%U
logon script = logon.bat
; name resolve order = wins lmhosts bcast
# This server is operating as the WINS server.
wins support = yes
; dns proxy = no
; preserve case = no
; short preserve case = no
; default case = lower
; case sensitive = no
add machine script = /etc/samba/dvuseradd.sh /usr/sbin/useradd -d /dev/null -g dvsws -s /bin/false -M %u
username map = /etc/samba/smbusers
strict allocate = yes
time server = yes
[homes]
comment = Home Directories
browseable = No
read only = Yes
# valid users = %D\%U
invalid users = root
[netlogon]
comment = Network Logon Service
path = /home/netlogon
read only = yes
invalid users = root
[share]
comment = Public share
path = /mnt/library0/share
writeable = yes
guest ok = yes
browseable = yes
fstype = Samba
create mask = 0775
directory mask = 0775
force create mode = 0664
force directory mode = 0775
invalid users = root
*There is probably some extra items in this file, but I thought I would post everything in it in case there is something amiss that I don't know should be added/removed.
Thanks in advance to anyone that can help with this. Been wrestling with the RHEL server to find the proper config for 2 days now...