Announcement

Collapse
No announcement yet.

LVE Wrappers

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LVE Wrappers

    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.

  • #2
    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

    Comment


    • #3
      Is this for Shell only or also for Jail Shell?

      Comment


      • #4
        This was only for shell, but plz, don use it.
        There is a better way now to do LVE for shell users

        Comment


        • #5
          Thanx Igor!
          Any alternative for Jail Shell on cpanel servers?

          Comment


          • #6
            Not yet, but SecureLVE should become available on cPanel within a next 30-60 days.

            Comment


            • #7
              Thanx Igor!

              Comment

              Working...
              X