PREIN
/bin/sh
if [ -n "`/bin/id -u sshd 2>/dev/null`" ]; then
if [ "`/bin/id -u sshd`" != "40" ]; then
echo "Error: user sshd doesn't have uid=40. Correct this before installing openssh-server." 1>&2
exit 1
fi
else
echo "Adding user sshd UID=40."
/usr/sbin/useradd \
\
-u 40 \
-r \
-d /usr/share/empty \
-s /bin/false \
-c "OpenSSH PrivSep User"\
-g nobody \
\
\
sshd 1>&2 || exit $?
[ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || :
fi;
PREUN
/bin/sh
if [ "$1" = "0" ]; then
{
if [ -f /var/lock/subsys/sshd ]; then
/sbin/service sshd stop 1>&2 || :;
fi }; /sbin/chkconfig --del sshd
fi
POSTIN
/bin/sh
/sbin/chkconfig --add sshd
{
skip_auto_restart() {
[ -f /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm
[ -f /etc/sysconfig/sshd ] && . /etc/sysconfig/sshd
echo ${RPM_SKIP_AUTO_RESTART:-no}
};
if [ $(skip_auto_restart) = no ]; then
if [ -f /var/lock/subsys/sshd ]; then
/sbin/service sshd reload 1>&2 || :;
else
echo 'Run "/sbin/service sshd start" to start openssh daemon.'
fi
fi };if ! grep -qs ssh /etc/security/passwd.conf ; then
umask 022
echo "ssh" >> /etc/security/passwd.conf
fi
POSTUN
/bin/sh
if [ "$1" = "0" ]; then
/usr/lib/rpm/user_group.sh user del sshd
fi