2006-08-27 14:57:50 +00:00
|
|
|
This document describes the installation of lamdaemon which is responsible
|
|
|
|
for managing quotas and creating home directories.
|
2005-07-06 11:07:53 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
|
|
|
|
Attention! The old version of lamdaemon is no longer supported. However,
|
|
|
|
if you do not install libssh2 then LAM will fall back to the old mechanismn.
|
|
|
|
If you want to stay with the old lamdaemon then change your /etc/sudoers entries
|
|
|
|
to point to lamdaemonOld.pl.
|
2008-03-08 13:23:25 +00:00
|
|
|
Do NOT mix lamdaemon and lamdaemonOld.pl!
|
2006-08-27 14:57:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
Setting up lamdaemon:
|
|
|
|
=====================
|
2005-07-06 11:07:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
Lamdaemon.pl is used to modify quota and home directories on a remote or local host via ssh.
|
|
|
|
If you want wo use it you have to set up some things to get it to work:
|
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
|
|
|
|
1. Setup values in LDAP Account Manager
|
2006-08-27 14:57:50 +00:00
|
|
|
=======================================
|
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
* Set the remote or local host in the configuration
|
|
|
|
(e.g. 127.0.0.1)
|
2006-10-26 17:50:40 +00:00
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
* Path to lamdaemon.pl, e.g. /srv/www/htdocs/lam/lib/lamdaemon.pl
|
2006-07-20 19:21:56 +00:00
|
|
|
If you installed a Debian or RPM package then the script may be located at
|
|
|
|
/usr/share/ldap-account-manager/lib or /var/www/html/lam/lib.
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2006-10-26 17:50:40 +00:00
|
|
|
* Your LAM admin user must be a valid Unix account. It needs to have the object class
|
|
|
|
"posixAccount" and an attribute "uid". This account must be accepted by the
|
|
|
|
SSH daemon of your home directory server.
|
|
|
|
Do not create a second local account but change your system to accept LDAP users.
|
|
|
|
You can use LAM to add the Unix account part to your admin user.
|
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
2. Setup sudo
|
|
|
|
=============
|
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
The perl script has to run as root. Therefore we need
|
|
|
|
a wrapper, sudo.
|
|
|
|
Edit /etc/sudoers on host where homedirs or quotas should be used
|
|
|
|
and add the following line:
|
2006-08-27 14:57:50 +00:00
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
$admin All= NOPASSWD: $path
|
2005-07-06 11:07:53 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
$admin is the admin user from LAM (must be a valid Unix account)
|
|
|
|
and $path is the path to lamdaemon.pl
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2008-12-18 14:57:28 +00:00
|
|
|
e.g.: myAdmin ALL= NOPASSWD: /srv/www/htdocs/lam/lib/lamdaemon.pl
|
2004-05-26 17:17:44 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
|
|
|
|
3. Setup Perl
|
|
|
|
==============
|
|
|
|
|
|
|
|
We need an extra Perl module - Quota
|
|
|
|
To install it, run:
|
2004-05-26 17:17:44 +00:00
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
perl -MCPAN -e shell
|
2006-08-27 14:57:50 +00:00
|
|
|
install Quota
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2004-05-26 17:17:44 +00:00
|
|
|
If your Perl executable is not located in /usr/bin/perl you will have to edit
|
|
|
|
the path in the first line of lamdaemon.pl.
|
2005-12-17 12:19:20 +00:00
|
|
|
If you have problems compiling the Perl modules try installing a newer release
|
|
|
|
of your GCC compiler and the "make" application.
|
2004-05-26 17:17:44 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
Several Linux distributions already include a quota package for Perl.
|
2004-12-06 17:31:09 +00:00
|
|
|
|
2004-05-26 17:17:44 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
4. Install libssh2
|
|
|
|
==================
|
2005-07-06 11:07:53 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
4.1 Install libssh2
|
|
|
|
You can get libssh2 here: http://www.libssh2.org
|
|
|
|
Unpack the package and install it by executing the commands
|
|
|
|
"./configure", "make" and "make install" in the extracted directory.
|
2005-07-06 11:07:53 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
4.2 Install SSH2 for PHP
|
|
|
|
The easiest way is to run "pecl install ssh2-beta". If you have no pecl command then install
|
|
|
|
the PHP Pear package (e.g. php-pear or php5-pear) for your distribution.
|
2004-05-26 17:17:44 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
If you want to compile it yourself, get the sources here: http://pecl.php.net/package/ssh2
|
2004-05-26 17:17:44 +00:00
|
|
|
|
2006-10-04 18:12:22 +00:00
|
|
|
After installing the PHP module please add this line to your php.ini:
|
|
|
|
extension=ssh2.so
|
|
|
|
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
5. Set up SSH
|
|
|
|
=============
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
Your SSH daemon must offer the password authentication method.
|
|
|
|
To activate it just use this configuration option in /etc/ssh/sshd_config:
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
PasswordAuthentication yes
|
2004-05-26 17:17:44 +00:00
|
|
|
|
|
|
|
|
2006-08-27 14:57:50 +00:00
|
|
|
Now everything should work fine.
|
2005-07-06 11:07:53 +00:00
|
|
|
|
|
|
|
|
2007-11-25 11:48:57 +00:00
|
|
|
6. Troubleshooting
|
2006-08-27 14:57:50 +00:00
|
|
|
======================
|
2005-07-06 11:07:53 +00:00
|
|
|
|
2006-10-04 18:12:22 +00:00
|
|
|
- There is a test page for lamdaemon:
|
|
|
|
Login to LAM and open Tools -> Tests -> Lamdaemon test
|
|
|
|
|
2007-11-25 11:48:57 +00:00
|
|
|
- If you get garbage characters at the test page then PHP and your php5-ssh2 library may not
|
|
|
|
fit together. Try recompiling the library and libssh2.
|
|
|
|
|
2008-02-11 19:03:13 +00:00
|
|
|
This combination was tested successfully: libssh2 0.13 with php5-ssh2 0.10
|
2008-12-18 14:57:28 +00:00
|
|
|
php5-ssh2 0.11 should have no problems with recent libssh2 releases.
|
2008-02-11 19:03:13 +00:00
|
|
|
|
2005-07-06 11:07:53 +00:00
|
|
|
- Check /var/log/auth.log or the equivalent on your system
|
|
|
|
This file contains messages about all logins. If the ssh login
|
|
|
|
failed then you will find a description about the reason here.
|
|
|
|
|
|
|
|
- Set sshd in debug mode
|
|
|
|
In /etc/ssh/sshd_conf add these lines:
|
|
|
|
|
|
|
|
SyslogFacility AUTH
|
|
|
|
LogLevel DEBUG3
|
|
|
|
|
|
|
|
Now check /var/log/syslog for messages from sshd.
|
2004-02-25 19:49:41 +00:00
|
|
|
|
2005-07-06 11:07:53 +00:00
|
|
|
- Update Openssh
|
|
|
|
A Suse Linux user reported that upgrading Openssh solved the problem.
|
2004-02-25 19:49:41 +00:00
|
|
|
|