码迷,mamicode.com
首页 > 其他好文 > 详细

堡垒机CrazyEye安装脚本

时间:2015-12-15 12:38:06      阅读:1082      评论:0      收藏:0      [点我收藏+]

标签:安装   脚本   堡垒机   crazyeye   

!!!!!!!!!!!!!!!!!!!!!

为什么crazyeye的安装过程官方写的那么烂??

!!!!!!!!!!!!!!!!!!!!!

照着做各种坑!!!!

文中所出现的IP是内部子网IP。各个包还需要自行下载。

需要自行下载这些包。
有些会通过yum或者pip下载
mysql-5.6.25.tar.gz
Python-2.7.5.tar.bz2
get-pip.py
shellinabox-master.zip
CrazyEye-master.zip



一、安装MySQL(自己安装)

yum install unzip -y
groupadd mysql
useradd -r -g mysql mysql
mkdir -p /usr/local/mysql
mkdir -p /usr/local/data/mysqldb
mkdir /root
cd /root
wget http://192.168.2.3/cobbler/ks_mirror/download/mysql-5.6.25.tar.gz
tar -zxvf mysql-5.6.25.tar.gz
cd mysql-5.6.25
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1
rm -rf CMakeCache.txt
make && make install
chown -R mysql:mysql /usr/local/mysql

/usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data 
cp /root/mysql-5.6.25/support-files/my-default.cnf /etc/my.cnf
cp /root/mysql-5.6.25/support-files/mysql.server /etc/init.d/mysqld  

ln -s /root/mysql-5.6.25/libmysql/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
ln -s /usr/local/mysql/mysql.sock /tmp/mysql.sock
cat > /etc/my.cnf << "EOF"
[mysqld]
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server=utf8

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
EOF

chmod 755 /etc/init.d/mysqld
service mysqld start
chkconfig mysqld on

echo "PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:\$PATH" >> /etc/profile
echo "export PATH" >> /etc/profile
source /etc/profile

mysqladmin -u root password ‘123456‘
mysql -uroot -p123456 -e "create database CrazyEyes character set utf8;"


二、更改linux的Python版本为2.7

yum install gcc gcc-c++ ncurses-devel perl
cd /root
wget http://192.168.2.3/install/crazyeye/Python-2.7.5.tar.bz2
tar xvf Python-2.7.5.tar.bz2
mkdir /usr/local/python27
cd Python-2.7.5
./configure --prefix=/usr/local/python27
make
make install
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/python27/bin/python /usr/bin/python
echo "PATH=/usr/local/python27/bin:/usr/local/crazyeye:\$PATH" >> /etc/profile
echo "export PATH" >> /etc/profile
source /etc/profile
sed -i ‘s/python/python2.6.6/‘ /usr/bin/yum


三、安装其他必须的软件

cd /root
wget http://192.168.2.3/install/crazyeye/get-pip.py
python get-pip.py
pip install Django==1.8.5
pip install django-suit==0.2.15
pip install django-session-security
pip install paramiko
yum install MySQL-python
pip install MySQL-python
#用于后台运行Python django server
yum install tmux
cd /root
wget http://192.168.2.3/install/crazyeye/shellinabox-master.zip
unzip shellinabox-master.zip
cd shellinabox-master/
./configure
make && make install
cd
wget http://192.168.2.3/install/crazyeye/CrazyEye-master.zip
unzip CrazyEye-master.zip
mv CrazyEye-master /usr/local/crazyeye 
sed -i "s/‘PASSWORD‘: ‘‘/‘PASSWORD‘: ‘123456‘/" /usr/local/crazyeye/CrazyEye/settings.py
sed -i "s/‘host‘:‘192.168.2.200‘,/‘host‘:‘192.168.1.74‘,/" /usr/local/crazyeye/CrazyEye/settings.py
sed -i "s/‘username‘:‘crazy_audit2‘,/‘username‘:‘bawoadm‘,/" /usr/local/crazyeye/CrazyEye/settings.py
sed -i "s/‘password‘: ‘123‘/‘password‘: ‘bawoadm‘/" /usr/local/crazyeye/CrazyEye/settings.py
python manage.py syncdb
python manage.py makemigrations
python manage.py migrate
#python manage.py createsuperuser
useradd crazyeyeadmin
passwd admin
echo "python /usr/local/crazyeye/crazy_eyes_mgr.py run" >> /home/crazyeyeadmin/.bashrc
echo "logout" >> /home/crazyeyeadmin/.bashrc
shellinaboxd -b -t
tmux
cd /usr/local/crazyeye
python manage.py runserver 0.0.0.0:8000


本文出自 “网络计算机” 博客,请务必保留此出处http://lovelinuxops.blog.51cto.com/10426562/1723076

堡垒机CrazyEye安装脚本

标签:安装   脚本   堡垒机   crazyeye   

原文地址:http://lovelinuxops.blog.51cto.com/10426562/1723076

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!