This blog is NOFOLLOW Free!

The magic space of the IT find what you seek or get lost

31Dec/07Off

syscp with libnss-mysql

After installing a new rootserver with syscp, I decided to also install libnss-mysql support on the system. The advantage is, that it is easy to see which file belongs to which user. I hate to only see the uids and gids 😉

Because I use gentoo on the server, I emerged libnss-mysql. If you use an other distribution, you have to install it with your package mananger if it is avaiable. I used version 1.5 of it.

Now it was a bit tricky to find the right config for syscp for it. After a long search and many tries now it works good. Here are my configs:

/etc/libnss-mysql-root.cfg:

username syscp
password SYSCPPASSWORD

/etc/libnss-mysql.cfg

getpwnam SELECT username,'x',uid,gid,username,homedir,shell \
FROM ftp_users \
WHERE username='%1$s' \
LIMIT 1
getpwuid SELECT username,'x',uid,gid,username,homedir,shell \
FROM ftp_users \
WHERE uid='%1$u' \
LIMIT 1
getpwent SELECT username,'x',uid,gid,username,homedir,shell \
FROM ftp_users
getspnam SELECT username,password,'12345','0','99999','7','','','' \
FROM ftp_users \
WHERE username='%1$s' \
LIMIT 1
getspent SELECT username,password,'12345','0','99999','7','','','' \
FROM ftp_users
getgrnam SELECT groupname,'',gid \
FROM ftp_groups \
WHERE groupname='%1$s' \
LIMIT 1
getgrgid SELECT groupname,'',gid \
FROM ftp_groups \
WHERE gid='%1$u' \
LIMIT 1
getgrent SELECT groupname,'',gid \
FROM ftp_groups
memsbygid SELECT username \
FROM ftp_users \
WHERE gid='%1$u'
gidsbymem SELECT gid \
FROM ftp_users \
WHERE username='%1$s'

host localhost
database syscp
username syscp
password SYSCPPASSWORD
#socket /var/lib/mysql/mysql.sock
#port 3306
timeout 3
compress 0

Now it would be good to also use this ;). So you have to change /etc/nsswitch.conf like this:

passwd: compat mysql
shadow: compat mysql
group: compat mysql

If you use the nscd don´t forget to restart it!

And that was it already 😉

Fatal error: Call to undefined function the_flattr_permalink() in /srv/www/webs/aschneider/magicspace_eu/htdocs/wp-content/themes/lightword-custom/single.php on line 23 Call Stack: 0.0001 235560 1. {main}() /srv/www/webs/aschneider/magicspace_eu/htdocs/index.php:0 0.0002 238520 2. require('/srv/www/webs/aschneider/magicspace_eu/htdocs/wp-blog-header.php') /srv/www/webs/aschneider/magicspace_eu/htdocs/index.php:17 0.3866 54285960 3. require_once('/srv/www/webs/aschneider/magicspace_eu/htdocs/wp-includes/template-loader.php') /srv/www/webs/aschneider/magicspace_eu/htdocs/wp-blog-header.php:19 0.3955 54716696 4. include('/srv/www/webs/aschneider/magicspace_eu/htdocs/wp-content/themes/lightword-custom/single.php') /srv/www/webs/aschneider/magicspace_eu/htdocs/wp-includes/template-loader.php:74