#!/bin/bash
#使用 sh -i ***.sh 命令執行指令碼
pid=$$
if (whiptail --title "確認防火牆狀態" --yesno "請確認您的防火牆允許2222埠通過;選擇yes將繼續,no終止."
1060) then
#echo "you chose yes. exit status was $?."
echo
"you chose yes."
yum -y install gcc* make perl pam pam-devel openssl-devel
yum upgrade openssl -y
[ -d /data ] || mkdir /data
cd /data
mkdir -p /etc/dropbear/
wget
tar jxf dropbear-2014.66.tar.bz2
cd dropbear-2014.66
./configure && make && make install
/usr/local/bin/dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
/usr/local/bin/dropbearkey -t rsa -s
4096
-f /etc/dropbear/dropbear_rsa_host_key
/usr/local/sbin/dropbear -p 2222
netstat -antup|grep 2222 &&echo
"dropbear install ok"||echo
"dropbear install error"
sleep 10s
cd ..
wget
yum remove openssh -y
mv /etc/ssh /etc/ssh.bak
tar zxf openssh-6.7p1.tar.gz && cd openssh-6.7p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords
make &&make install
cp /data/openssh-6.7p1/contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
service sshd start
#service sshd reload
echo
"安裝成功,請測試。如無問題,請結束dropbear程序"
else
#echo "you chose no. exit status was $?."
kill -9
$pid >/dev/null
fi#kill -9 `netstat -antp |grep 2222 |grep "listen"| awk 'nr==1'''|awk -f/ ''`
sleep 9
CentOS下MongoDB的公升級
8月29號,mongodb發行了最新的資料庫版本2.2.0.今天我來把它公升級一下.下面記錄下我的相關操作.首先,我檢視一下mongod服務有沒有在執行.可以用下面兩個命令檢視 root mysql master ps ef grep mongo root 3244 1 0 aug15 00 00 ...
Linux下遠端公升級指令碼
remote update.sh bin sh 此指令碼放在dcu資料夾的外面 殺掉正在執行的dcu程序 pidlist ps ef grep dcu.bin grep v grep awk echo id list pidlist if pidlist then else for pid in d...
CentOS下OpenSSH版本公升級
1 進入centos系統後,切換到root使用者,檢視當前openssh版本 安裝依賴環境 yum install gcc gcc c autoconf automake yum y install zlib zlib devel openssl openssl devel pcre pcre de...