Jump to content
Froxlor Forum
  • 0

nscd in CentOS7


roothahn

Question

Hi all,
 
did anyone try using froxlor with CentOS 7?
 
I'm stuck at nscd. Installed the package "nscd" and "libnss-mysql" provided by CentOS and took the debian-wheezy example (in /usr/share/docs/libnss/examples are bg-types of queries).
After "service nscd restart" (I rebooted too), the system still doesn't know the user (which is definitely in the ftp_users table):

# ls -al /home/webs/silvio
rwxr-xr-x. 3 root  root  4096 27. Aug 21:21 .
drwxr-xr-x. 5 root  root  4096 27. Aug 20:47 ..
drwxr-xr-x. 2 10000 10000 4096 27. Aug 20:47 silvio
[root@web webs]# chown -R silvio silvio
chown: ung?ltiger Benutzer: ?silvio?                       # translation: "unknown user"

 
After setting the logging in "/etc/nscd.conf" to "debug-level 9" that's what the log tells me when I ?chown?: 

Do 28 Aug 2014 09:51:36 CEST - 29868: handle_request: Anforderung empfangen (Version = 2) vom Prozess 30018
Do 28 Aug 2014 09:51:36 CEST - 29868:   GETFDPW
Do 28 Aug 2014 09:51:36 CEST - 29868: Erm?gliche Zugriff auf Datei-Deskriptor ?8?, f?r passwd
Do 28 Aug 2014 09:51:36 CEST - 29868: handle_request: Anforderung empfangen (Version = 2) vom Prozess 30018
Do 28 Aug 2014 09:51:36 CEST - 29868:   GETPWBYNAME (silvio)
Do 28 Aug 2014 09:51:36 CEST - 29868: Habe ?silvio? nicht im Password-Cache gefunden!
Do 28 Aug 2014 09:51:36 CEST - 29868: F?ge neuen Eintrag ?silvio? vom Typ GETPWBYNAME f?r passwd zu cache (erster) hinzu

It just said that the user is not found in cache and adds a new entry, but it seems to me that it just looks in the "files" switch, it seems he tries not even to use the "mysql" switch.

Here are my configs:
 
/etc/libnss-mysql.cfg 

getpwnam    SELECT username,'x',uid,gid,'MySQL User',homedir,shell \
            FROM ftp_users \
            WHERE username='%1$s' \
            AND login_enabled = 'Y' \
            LIMIT 1
getpwuid    SELECT username,'x',uid,gid,'MySQL User',homedir,shell \
            FROM ftp_users \
            WHERE uid='%1$u' \
            AND login_enabled = 'Y' \
            LIMIT 1
getspnam    SELECT username,password,FLOOR(UNIX_TIMESTAMP()/86400-1),'1','99999','7','-1','-1','0' \
            FROM ftp_users \
            WHERE username='%1$s' \
            AND login_enabled = 'Y' \
            LIMIT 1
getpwent    SELECT username,'x',uid,gid,'MySQL User',homedir,shell \
            FROM ftp_users
getspent    SELECT username,password,FLOOR(UNIX_TIMESTAMP()/86400-1),'1','99999','7','-1','-1','0' \
            FROM ftp_users
getgrnam    SELECT groupname,'x',gid \
            FROM ftp_groups \
            WHERE groupname='%1$s' \
            LIMIT 1
getgrgid    SELECT groupname,'x',gid \
            FROM ftp_groups \
            WHERE gid='%1$u' \
            LIMIT 1
getgrent    SELECT groupname,'x',gid \
            FROM ftp_groups
memsbygid   SELECT username \
            FROM ftp_users \
            WHERE gid='%1$u' UNION SELECT 'apache'
gidsbymem   SELECT gid \
            FROM ftp_users \
            WHERE username='%1$s' UNION SELECT gid FROM ftp_users WHERE 'apache'='%1$s'

host        localhost
database    froxlor
username    froxlor
password    froxlor
socket      /var/lib/mysql/mysql.sock
#port       3306    #tried with socket or port alone and tried with both socket and port set

to prove the socket exists:

srwxrwxrwx. 1 mysql mysql 0 27. Aug 20:55 /var/lib/mysql/mysql.sock 

/etc/libnss-mysql-root.cfg 

username    froxlor
password    froxlor

/etc/nsswitch.conf 

passwd:      files sss mysql
shadow:      files sss mysql
group:       files sss mysql

To prove the database is ok: 

MariaDB [froxlor]> select username,uid,gid,password,homedir,shell from ftp_users where username = "silvio";
+----------+-------+-------+------------------------------------+--------------------+------------+
| username | uid   | gid   | password                           | homedir            | shell      |
+----------+-------+-------+------------------------------------+--------------------+------------+
| silvio   | 10000 | 10000 | $1$BmhsksjjuekdsjfsAeYTlKPB.Ak0OD0 | /home/webs/silvio/ | /bin/false |
+----------+-------+-------+------------------------------------+--------------------+------------+

Thanks for any hint! :-)

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Am 19.9.2014 um 21:37 schrieb roothahn:

the solution was ridiculous:  I found out that nscd isn't actually needed (since the users dont log in) and caused the problems. libnss-mysql is sufficient for getting the usernames.

Thanks you such much!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...