X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage3%2Fpkg%2Fopenssh;h=58707cee4c9bcc9927a3bffa31405f0662dc4ffd;hb=ec1aff0d1ba15c272b63662766fdc29970db642d;hp=2e36ee071e2fe9c9940516c0bc40b0a992f5b1b0;hpb=3dae4c554ec18f465eb6ee5e6efdbdbe8557e13c;p=hvlinux.git diff --git a/stage3/pkg/openssh b/stage3/pkg/openssh index 2e36ee0..58707ce 100644 --- a/stage3/pkg/openssh +++ b/stage3/pkg/openssh @@ -1,49 +1,37 @@ -#!/bin/sh -set -o errexit - -# First argument of this script is the package name - -# Reading system configuration informations, functions and package versions. -source ../sysinfos -source ../functions -source ../packages-list - -# Applying patches (if any) -apply_patches ${1} - -install -v -m700 -d /var/lib/sshd -chown -v root:sys /var/lib/sshd - -groupadd -f sshd -hv_useradd -c sshd-privsep -d /var/lib/sshd -g sshd -s /bin/false sshd - -cd ${LFS_TMP}/${1}-build -../${1}/configure \ - --prefix=/usr \ - --sysconfdir=/etc/ssh \ - --datadir=/usr/share/sshd \ - --with-pam \ - --libexecdir=/usr/lib/openssh \ - --with-md5-passwords \ - --with-privsep-path=/var/lib/sshd -make -j ${MAKEJOBS} -make -j ${MAKEJOBS} install - -cd ${LFS_TMP}/${1} -install -v -m755 -d /usr/share/doc/${1} -install -v -m644 INSTALL LICENCE OVERVIEW README* WARNING.RNG \ - /usr/share/doc/${1} - -# Disabling root logins -sed -i -e "s!^#PermitRootLogin.*!PermitRootLogin no!g" /etc/ssh/sshd_config - -# Enabling X11 forwarding -sed -i -e "s!^#X11Forwarding.*!X11Forwarding yes!g" /etc/ssh/sshd_config - -# Setting MaxAuthTries to 2 -sed -i -e "s!^[#]*MaxAuthTries.*!MaxAuthTries 3!g" /etc/ssh/sshd_config - -install -v -m740 ${SCRDIR}/bootscripts/sshd /etc/rc.d/init.d -bootscript_add_rc3 sshd 25 70 - -exit $? +#!/bin/bash + +hvconfig_pre() +{ + install -v -m700 -d /var/lib/sshd + chown -v root:sys /var/lib/sshd + + groupadd -f sshd + hv_useradd -c sshd-privsep -d /var/lib/sshd -g sshd -s /bin/false sshd + + CONFIGURE_OPTS="\ + ${CONFIGURE_OPTS} \ + --sysconfdir=/etc/ssh \ + --datadir=/usr/share/sshd \ + --with-pam \ + --libexecdir=/usr/lib/openssh \ + --with-md5-passwords \ + --with-privsep-path=/var/lib/sshd" +} + +hvbuild_post() +{ + # Disabling root logins + sed -i -e "s!^#\(PermitRootLogin\).*!\1 no!g" /etc/ssh/sshd_config + + # Enabling X11 forwarding + echo "XAuthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config + sed -i -e "s!^#\(X11Forwarding\).*!\1 yes!g" /etc/ssh/sshd_config + sed -i -e "s!^#\(ForwardAgent\).*!\1 yes!g" /etc/ssh/ssh_config + sed -i -e "s!^#\(ForwardX11\).*!\1 yes!g" /etc/ssh/ssh_config + + # Setting MaxAuthTries to 2 + sed -i -e "s!^[#]*MaxAuthTries.*!MaxAuthTries 3!g" /etc/ssh/sshd_config + + install -v -m740 ${SCRDIR}/bootscripts/sshd /etc/rc.d/init.d + bootscript_add_rc3 sshd 25 70 +}