-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
32 lines (22 loc) · 817 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Install dependencies
BUILD_PKGS="supervisor git python-pip python-virtualenv libmpfr-dev libssl-dev libmpc-dev libffi-dev build-essential libpython-dev python2.7-minimal python-setuptools authbind python2.7"
apt-get update
apt-get install -y ${BUILD_PKGS}
apt-get clean
# Create a user account
groupadd --gid 1000 cowrie
useradd -m --uid 1000 --gid 1000 -d /home/cowrie -m cowrie
# Install & Setup Virtual Environment
su - cowrie -c "\
cd && \
git clone https://github.com/micheloosterhof/cowrie && \
cd /home/cowrie/cowrie && \
virtualenv cowrie-env && \
source cowrie-env/bin/activate && \
pip install -r /home/cowrie/cowrie/requirements.txt "
# Generate a DSA key
cd /home/cowrie/cowrie/data
ssh-keygen -t dsa -b 1024 -f ssh_host_dsa_key
cd /home/cowrie
chown -R cowrie:cowrie /home/cowrie