wget http://dsc-svc-08/openssh-6.4p1.tar.gz
yum install zlib-devel
yum install openssl-devel
tar xvf openssh-6.4p1.tar.gz
cd openssh-6.4p1/
./configure --prefix=/usr/local/openssh6.4p1
yum erase openssh
ssh -V
make
make install
ln -s /usr/local/openssh6.4p1/bin/ssh /usr/bin/ssh
vi /etc/init.d/sshd
systemctl enable sshd
chmod 755 /etc/init.d/sshd
ssh -V
cat /etc/init.d/sshd
#!/bin/sh
# chkconfig: 345 99 19
# description: sshd daemon
cnt=`ps -ef|grep '/usr/local/openssh6.4p1/sbin/sshd'|grep -v grep |wc -l`
case "$1" in
start)
if [ ${cnt} -ne 0 ]
then
echo "sshd daemon is aleady"
else
/usr/local/openssh6.4p1/sbin/sshd
echo "sshd daemon is start"
fi
;;
stop)
if [ ${cnt} -ne 0 ]
then
ps -ef|grep '/usr/local/openssh6.4p1/sbin/sshd'|grep -v grep|awk '{print $2}'|xargs kill
echo "sshd is down"
else
echo "sshd is aleady down"
fi
;;
status)
if [ ${cnt} -ne 0 ]; then
echo "sshd is running"
else
echo "sshd is down"
fi
;;
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit $?