Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:lsmcd:user_cpanel [2018/07/26 12:27]
Robert Perper [Install the Software]
litespeed_wiki:lsmcd:user_cpanel [2020/07/07 15:42] (current)
Jackson Zhang [LSMCD Secure User Data CloudLinux/cPanel Interface]
Line 3: Line 3:
 This facility provides a user interface for those CloudLinux/​cPanel users using LSMCD configured with SASL and User-Level security. ​ See [[litespeed_wiki:​lsmcd:​sasl_secure_user_data|LSMCD Secure User Data Using SASL]]. This facility provides a user interface for those CloudLinux/​cPanel users using LSMCD configured with SASL and User-Level security. ​ See [[litespeed_wiki:​lsmcd:​sasl_secure_user_data|LSMCD Secure User Data Using SASL]].
  
-This interface is intended for cPanel end-users. ​ Administrators will need to use the command line SASL to create and delete ​users. ​ This panel lets a user change their own password and see statistics for their specific data in their user-managed LSMCD space.+This interface is intended for cPanel end-users. ​ This panel lets a user change their own password and see statistics for their specific data in their user-managed LSMCD space
 + 
 +WHM Administrators will need to use the command line SASL to create and delete users. Users must be created in advance and must match their cPanel user names. There is a way to automatically create a user for each cPanel user for WHM administrator explained later in this article.
  
 ===== Installation ===== ===== Installation =====
Line 23: Line 25:
   ./​install.sh   ./​install.sh
 The install should run without errors, but any significant ones will be displayed on the screen. ​ It will determine if lsmcd has been installed and install it if it's not already there. The install should run without errors, but any significant ones will be displayed on the screen. ​ It will determine if lsmcd has been installed and install it if it's not already there.
 +
 +If you see missing dependencies,​ particularly concerning Perl and Git, check your ''/​etc/​yum.conf''​ file.  You must not have ''​perl*''​ in the exclude list.  If it's there, temporarily remove it and try the install script again.
  
 ===== Administration ===== ===== Administration =====
Line 30: Line 34:
 Users must be created in advance and must match their cPanel user names. ​ Passwords and stats can be managed by the users themselves using the cPanel plugin described here. Users must be created in advance and must match their cPanel user names. ​ Passwords and stats can be managed by the users themselves using the cPanel plugin described here.
  
 +There is a way to automatically create a user for each cPanel user for WHM administrator. You may use a script like the following when you ssh login as a root user:
 +
 +<​code>​
 +#!/bin/bash
 +
 +user_list=$(sasldblistusers2 /​etc/​sasllsmcd | cut -d@ -f1)
 +#get current user list
 +
 +for name in $(ls /home/);
 +do 
 +  if [[ -d /​home/​$name/​public_html ]] ; then
 +  #check public_html existance to make sure it's vhost user instead of cPanel created dir
 +        if ! echo $user_list | grep -i -q $name ; then    ​
 +            #check if user already in the list to avoid override existing users
 +            passwd=$(head /​dev/​urandom | tr -dc A-Za-z0-9 | head -c 10 ; echo ''​)
 +            echo $passwd | saslpasswd2 -p -f /​etc/​sasllsmcd $name
 +            # use -p to set a random password without prompt ​
 +            echo "$name added into LSMCD"
 +        else 
 +            echo "$name already in the list..."​
 +        fi
 +  fi
 +done
 +</​code>​
 +
 +You can also use the similar commands to create a custom script, and hook up with cPanel user creation to auto-run it.
 +
 +  passwd=$(head /​dev/​urandom | tr -dc A-Za-z0-9 | head -c 10 ; echo ''​)
 +  echo $passwd | saslpasswd2 -p -f /​etc/​sasllsmcd $name
 ===== Use ===== ===== Use =====
 Once the software is installed, cPanel users will see a new option in their **Advanced** group: Once the software is installed, cPanel users will see a new option in their **Advanced** group:
Line 41: Line 74:
 This screen has 3 groups of data: This screen has 3 groups of data:
   - Who you are:   - Who you are:
-    - User to be used for LSMCD+    - User to be used for LSMCD (the logged on user)
     - LSMCD server address extracted from ''/​usr/​local/​lsmcd/​conf/​node.conf''​. ​ Can be an IP address/​port or UDS (Unix Domain Socket).     - LSMCD server address extracted from ''/​usr/​local/​lsmcd/​conf/​node.conf''​. ​ Can be an IP address/​port or UDS (Unix Domain Socket).
-    - Whether SASL security is enabled +    - Whether SASL security is enabled ​(the setting of ''​Cached.UseSasl''​ in node.conf) 
-    - Whether User Level Security is enabled+    - Whether User Level Security is enabled ​(the setting of ''​Cached.DataByUser''​ in node.conf).
   - A button to change the password. ​ Will only be enabled if SASL and User Level Security is enabled.   - A button to change the password. ​ Will only be enabled if SASL and User Level Security is enabled.
   - A button to display stats. ​ If user level security is enabled, the stats will be only for the user.  If no security is enabled, the stats are system wide.  Otherwise the button is disabled.   - A button to display stats. ​ If user level security is enabled, the stats will be only for the user.  If no security is enabled, the stats are system wide.  Otherwise the button is disabled.
  • Admin
  • Last modified: 2018/07/26 12:27
  • by Robert Perper