If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
We need a little more information about LVE Wrappers for cpanel integration.
Can you guys give us some examples for integrating LVE Wrappers for mysql and exim, in cpanel? Thanks.
I don have examples for that yet. But I have a script that would convert all cpanel users to use LVE shells (if you have shell enabled)
To run: edit lve_shellify.sh, and change HOME variable to point to the directory where all home users are. It is usually /home, but sometimes it is something else. We use the fact that user name matches directory name for the user to find all "non system" users.
The script will:
save a copy of passwd file in /etc/passwd.old.shellify
save a copy of shells file in /etc/shells.old.shellify
(so that you can restore them later on)
Changes /etc/shells to have only lve_shells, and /sbin/nologin (if something else is used -- you can add it there)
Walks through each user in /etc/home directory, and if the user has shell access, it changes it to correct lve counterpart
Code:
#!bin/sh
# lve_shellify.sh
HOME=/home
if [ ! -f /etc/passwd.old.shellify ]; then
cp /etc/passwd /etc/passwd.old.shellify
fi
if [ ! -f /etc/shells.old.shellify ]; then
cp /etc/shells /etc/shells.old.shellify
fi
cat > /etc/shells <<SHELLS
/bin/lve_bash
/bin/lve_ksh
/bin/lve_pdksh
/bin/lve_tcsh
/bin/lve_zsh
/sbin/nologin
SHELLS
cd $HOME
for user in *; do
shell=`grep -e "^$user:" /etc/passwd|cut -d":" -f7`
if [ "1$shell" = "1/bin/bash" ]; then
chsh -s /bin/lve_bash $user
elif [ "1$shell" = "1/bin/ksh" ]; then
chsh -s /bin/lve_ksh $user
elif [ "1$shell" = "1/bin/pdksh" ]; then
chsh -s /bin/lve_pdksh $user
elif [ "1$shell" = "1/bin/tcsh" ]; then
chsh -s /bin/lve_tcsh $user
elif [ "1$shell" = "1/bin/zsh" ]; then
chsh -s /bin/lve_zsh $user
fi
done
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment