LVE Wrappers
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. Xanubi
  2. Saturday, 26 June 2010
  3.  Subscribe via email
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.
Rate this post:
  1. 27.06.2010 22:06:43
  2. # 1
Igor Seletskiy Accepted Answer
Posts: 1200
Joined: 09.02.2010
0
Votes
Undo
I don\'t 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

#!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

  1. 16.03.2011 17:03:29
  2. # 2
Manuel Kissoyan Accepted Answer
Posts: 23
Joined: 16.03.2011
0
Votes
Undo
Is this for Shell only or also for Jail Shell?
  1. 16.03.2011 20:03:16
  2. # 3
Igor Seletskiy Accepted Answer
Posts: 1200
Joined: 09.02.2010
0
Votes
Undo
This was only for shell, but plz, don\'t use it.
There is a better way now to do LVE for shell users
http://www.cloudlinux.com/docs/pam_lve.php
  1. 17.03.2011 09:03:47
  2. # 4
Manuel Kissoyan Accepted Answer
Posts: 23
Joined: 16.03.2011
0
Votes
Undo
Thanx Igor!
Any alternative for Jail Shell on cpanel servers?
  1. 17.03.2011 09:03:42
  2. # 5
Igor Seletskiy Accepted Answer
Posts: 1200
Joined: 09.02.2010
0
Votes
Undo
Not yet, but SecureLVE should become available on cPanel within a next 30-60 days.
  1. 17.03.2011 09:03:30
  2. # 6
Manuel Kissoyan Accepted Answer
Posts: 23
Joined: 16.03.2011
0
Votes
Undo
Thanx Igor!
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.