修改/etc/ssh/ssh_config
vim /etc/ssh/ssh_config
將# StrictHostKeyChecking ask
改為StrictHostKeyChecking no
這樣ssh第一次連接不會詢問
/etc/init.d/reboot.sh
#!/bin/sh
source /etc/profile
echo "start"
TIME=`cat /proc/uptime |cut -d. -f1`
# 注意這里是秒為單位 太長時間會被kill掉 60左右吧
while (($TIME<30))
do
echo "開始任務..."
cat /root/.ssh/id_rsa.pub > /root/.ssh/known_hosts
/usr/bin/ssh root@localhost -D 0.0.0.0:8808 -fN
echo "當前開機時間${TIME}"
sleep 3s
TIME=`cat /proc/uptime |cut -d. -f1`
done
然后其它開機設置參考
http://www.reibang.com/p/bd56b169252d
最后面的